## Exercice 1 : Euler ## Q1 def puissance_cinq(N): n=int(N**(1/5)) return abs(n-N**(1/5))<10**(-10) ## Q2 for a in range(1,150): for b in range(a,150): for c in range(b,150): for d in range(c,150): E=a**5+b**5+c**5+d**5 if puissance_cinq(E): print (a,b,c,d,int(E**(1/5))) print(a) # 27 84 110 133 144 ## Exercice 2 : Somme et racine ## Q3 def smr(n): m=len(str(n))//2 a=n//(10**m) b=n%(10**m) return (a+b)**2==n ## Q4 for n in range(1,1000000): if len(str(n))%2==0 and smr(n): m=len(str(n))//2 a=n//(10**m) b=n%(10**m) print(a,'+',b,' = √',n,sep='') # 8+1 = √81 # 20+25 = √2025 # 30+25 = √3025 # 98+1 = √9801 # 494+209 = √494209 # 998+1 = √998001 ## Exercice 3 : Conway ## Q5 def prefixe(s): c=s[0] k=0 while k0: s+=str(m%b) m//=b return int(s[::-1]) ## Q9 def conway_b_suivant(n,b): s=str(n) S='' r=0 while r