If you do solve it, do it on a completely offline computer, running MS-DOS with no network cards. Don't ever plug in a USB or other drive. Only write to floppy disks which you've bulk erased then formatted first for your backups. (That should prevent your secret from leaking, if you keep quiet)
Your only safe bet, in my opinion, is to disclose your algorithm widely in such a manner as all copies can't be vacuumed up.
However, know that the disclosure of such a factoring algorithm will have far reaching and unpredictable consequences.
You could try to take advantage of it by breaking some old unused bitcoin wallets, but the money would be tracked to you eventually, and you'd be subjected to physical attack to disclose it (your algorithm) exclusively, then killed. Theoretically you could time it with disclosure, but you're then risking criminal charges for the theft of the bitcoins.