The idea was to have a legitimate reason to publish the code.
He found a representation of the code that was also the tenth largest prime found using ECPP meaning he could publish the finding and claim he wasn't publishing the code. However, anyone who wanted the code could easily find it by looking up the prime