Commit 0a003671 authored by Taddeus Kroes's avatar Taddeus Kroes

Solved 46

parent 5f5961bc
#!/usr/bin/env python
from utils import primes_until
MAX = 10000
comps = [False] * MAX
comps[1] = True
for p in primes_until(MAX - 1):
q = 1
comps[p] = True
while True:
pplusq = p + 2 * q ** 2
if pplusq >= MAX:
break
comps[pplusq] = True
q += 1
for i, passed in enumerate(comps):
if i & 1 and not passed:
print i
break
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment