Joined July 2014
·
Posted to
Prime Numbers with Python v2
over 1 year
ago
Thanks for writing these up.
I may be confused, but isn't there a mistake in the baillie_psw() method?
Where it says
for i in xrange(3, limit + 1, 2):
if n % i:
return n == i
shouldn't the if condition say
if n % i == 0:
? Because you're going to return an answer only if n is divisible by i.
Lars
Silly formatting...
Thanks for writing these up.
I may be confused, but isn't there a mistake in the baillie_psw() method?
Where it says
shouldn't the if condition say
? Because you're going to return an answer only if n is divisible by i.
Lars