(Python)
import math
def power(a, n):
...pow = 1
...for i in range(0, n):
......pow = pow * a
...return pow
end = 50
for n in range(1, end):
...l1 = 1/math.log(5)*(math.log(math.sqrt(2)-1)+(n-2)/2*math.log(2))+ n/2
...u1 = 1/math.log(5)*(math.log(math.sqrt(11)-1)+(n-3)/2*math.log(2))+ (n-1)/2
...if math.ceil(l1) == math.floor(u1) and math.ceil(l1)>0:
......p = math.ceil(l1)
......x = power(5, p)*(-1)+power(2, n-2)*power(5, n-p)
......print(x*x)
...l2 = 1/math.log(5)*(math.log(math.sqrt(11)+1)+(n-3)/2*math.log(2))+ (n-1)/2
...u2 = 1/math.log(5)*(math.log(math.sqrt(2)+1)+(n-2)/2*math.log(2))+ n/2
...if math.ceil(l2) == math.floor(u2) and math.ceil(l2)>0:
......p = math.ceil(l2)
......x = power(5, p)-power(2, n-2)*power(5, n-p)
......print(x*x)
print('End.')
(PARI)
for(n=1, 10^20, p=n^2; if(p%100, s=concat("1", Str(p)); if(issquare(eval(s)), print1(p, ", ")))) \\ Derek Orr, Aug 23 2014
|