Last year, I wrote about prime factorization at the old Singularity blog. The post included an AS 2 implementation of a textbook algorithm along with some pointers to more advanced methods such as the quadratic sieve and GNFS (General Number Field Sieve ).
A lot of work has gone into factoring numbers on the RSA Challenge List. Now, a team including members of the University of Bonn, NTT, and Arjen Lenstra has tackled the Mersene number 2^1039 – 1. Read more about their results here.
You may download the simple textbook prime factorization from the Downloads section.