Skip to content

Commit

Permalink
Create primegen.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cardinal9999 authored Aug 16, 2021
1 parent e0b674d commit 18174b9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cryptoquail/primegen.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
def generate(range_, start):
count = range_
primes = []
for p in range(count):
i = p + start
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79]
a = 0
for x in prime:
if (x ** (i-1)) % i == 1:
a += 1
if a == len(prime):
primes.append(i)
return primes

0 comments on commit 18174b9

Please sign in to comment.