This code solves the integer factorization and primality problems in polynomial time. O(log log N) time. This is an improvement over the AKS primality test proposed by Agarwal, Kayal and Saxena (http://en.wikipedia.org/wiki/AKS_primality_test)