Initial release

This commit is contained in:
Francois JUMELLE
2021-05-03 22:32:40 +02:00
commit 20526d93c8
928 changed files with 452368 additions and 0 deletions

34
Einstein.py Normal file
View File

@@ -0,0 +1,34 @@
from math import sqrt
def premiers(n):
prem=list(range(2,n+1))
k=2
nRacine=sqrt(n)
while k<nRacine:
prem=[p for p in prem if p<=k or p%k!=0]
k=prem[prem.index(k)+1] # nouveau nombre premier
return prem
prem = premiers(100000)
sol = list()
E = 1
while len(sol)<4 and E < max(prem):
for c in prem:
if 2 * c**2 > E:
break
if E%(c**2)==0 and E//(c**2) in prem:
if len(sol) == 0 or sol[-1]+2 == E:
sol.append(E)
if len(sol) > 1:
print(sol, end=' ')
else:
if len(sol) > 1:
print("NOK")
sol = list()
sol.append(E)
E += 2
print("\n\n")
print(sol)