Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Restricted Prime by Moff
def checkio(n):
limit = n + n
res = [False, False] + [True] * limit
a = int(True)
while a < limit:
a += int(True)
if not res[a]:
continue
b = a * a
while b < limit:
res[b] = False
b += a
return res[n]
Aug. 11, 2015