Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
22
Task/Sisyphus-sequence/Python/sisyphus-sequence-2.py
Normal file
22
Task/Sisyphus-sequence/Python/sisyphus-sequence-2.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import primesieve
|
||||
|
||||
def sisyphus36():
|
||||
primes = primesieve.Iterator()
|
||||
n = 1
|
||||
p = 0
|
||||
i = 1
|
||||
|
||||
while True:
|
||||
i += 1
|
||||
if n % 2:
|
||||
p = primes.next_prime()
|
||||
n = n + p
|
||||
else:
|
||||
n = n // 2
|
||||
|
||||
if n == 36:
|
||||
print(f"{i:,}, {n:,}, {p:,}")
|
||||
break
|
||||
|
||||
if __name__ == "__main__":
|
||||
sisyphus36()
|
||||
Loading…
Add table
Add a link
Reference in a new issue