(no title)
marethyu | 3 months ago
from math import sqrt
def isPerfectSquare(n):
sr = int(sqrt(n))
return sr * sr == n
for N in range(1, 10000000000):
foo = 1 + 12*(N*N + N)
bar = 1 + 4*(N*N + N)
if isPerfectSquare(foo) and isPerfectSquare(bar):
x, y = int(sqrt(foo)), int(sqrt(bar))
if (1+x)%6 == 0 and (1+y)%4 == 0:
print(f'Candidate found: N={N}, T_N={N*(N+1)/2}')
No comments yet.