Triplets pythagoriciens, je cherchais en particulier des non multiples de 5; il n’y en a pas, pourquoi?
import cmath from math import sqrt L={complex(i,j)**2 for i in range(1,6) for j in range(1,i)} L=list(map(lambda z: (round(z.real),round(z.imag),round(sqrt(z.real**2+z.imag**2))),L)) print(L) #L={z for z in L if ((z.real*z.imag) %5 !=0)and((z.real**2+z.imag**2) %5 !=0)} #L=[1 for i in range(8) for j in range(i,8) for k in range(j,8)] #print(sum(L))