Oct-27-2017, 07:08 PM
(Oct-27-2017, 06:58 PM)heiner55 Wrote: Your algorithm is wrong, because
print(isPrime(5))
results in None instead of true.
You're right... I actually just removed the lower digit checks altogether. I used them to check to see if things were working on lower numbers before I set everything up for 16 digit numbers.
so, this is what is needed:
#!python3 def isPrime(num): for div in range(2,int(num / 2)): if num % div == 0: return False return True for i in range(1000000000000000,9999999999999999): if isPrime(i): i = (i * 2) + 1 if isPrime(i): print(int((i - 1) / 2)) break