Talk:Factors of a Mersenne number

From Rosetta Code
Revision as of 19:59, 16 January 2009 by rosettacode>Spoon!

Algorithm incorrect?

In testing some other Mersenne numbers, I get false negatives from the Python program. Both M59 and M6007 are not prime and should yield a factor, right? If this is expected, maybe some more clarification is needed in the description. --IanOsgood 19:28, 16 January 2009 (UTC)

I think the arbitrary limit of (16384 / p) is too small for those cases. I found a factor for M59 by increasing the limit. But I don't know how to determine what is a good limit to use. In the worst case we can just use sqrt(Mp) as the limit I guess. That will make testing the actual prime cases take really long. --Spoon! 19:59, 16 January 2009 (UTC)