Journal dcowart's Journal: A086865 solution in python
OEIS A086865 in python
import math
def isprime(possprime):
"""returns t/f if number is prime or not"""
for x in range(2, int(possprime/2)+1):
if possprime % x == 0:
return False
else:
return True
n = 0
while n < 10:
pp = 2 * math.pow(10,n) + 11
print "Working on ", n
if isprime(pp):
print n, " gives ", pp, " which is prime."
n=n+1
Works for python up to n = 8. Then runs out of memory
A086865 solution in python More Login
A086865 solution in python
Slashdot Top Deals