Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Euclid-Mullin-sequence/Python/euclid-mullin-sequence.py
Normal file
14
Task/Euclid-Mullin-sequence/Python/euclid-mullin-sequence.py
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
""" Rosetta code task: Euclid-Mullin_sequence """
|
||||
|
||||
from primePy import primes
|
||||
|
||||
def euclid_mullin():
|
||||
""" generate Euclid-Mullin sequence """
|
||||
total = 1
|
||||
while True:
|
||||
next_iter = primes.factor(total + 1)
|
||||
total *= next_iter
|
||||
yield next_iter
|
||||
|
||||
GEN = euclid_mullin()
|
||||
print('First 16 Euclid-Mullin numbers:', ', '.join(str(next(GEN)) for _ in range(16)))
|
||||
Loading…
Add table
Add a link
Reference in a new issue