Add python script to generate the bits needed for the prime generator.

This commit is contained in:
Felix Laurie von Massenbach 2014-05-27 02:13:33 +01:00 committed by Ben Laurie
parent c09ec5d2a0
commit 8a12085293

21
tools/primes.py Normal file
View File

@ -0,0 +1,21 @@
primes = [2, 3, 5, 7]
safe = True
muliplier = 1
for p in primes:
muliplier *= p
offsets = []
for x in range(3, muliplier + 3, 2):
prime = True
for p in primes:
if not x % p or (safe and not ((x - 1) / 2) % p):
prime = False
break
if prime:
offsets.append(x)
print(offsets)
print(len(offsets))
print(muliplier)