from time import time
t0 = time()
r = 2
listA = []
top = 100
for n in range(-top, top + 1):
for d in range(1, top + 1):
if gcd(n,d) == 1:
a = QQ(n) / QQ(d)
e = sqrt(a * (a + 1) / r)
if (e in QQ) and a != -1 and a != 0:
listA.append(a)
print(listA)
print(len(listA))
print(time() - t0)
[-98/17, -98/73, -98/89, -98/97, -81/31, -81/49, -81/73, -81/79, -72/23, -72/47, -72/71, -50, -50/41, -50/49, -49/17, -49/31, -49/41, -49/47, -32/7, -32/23, -32/31, -25/7, -25/17, -25/23, -18/17, -9, -9/7, -8/7, -2, 1, 1/7, 1/17, 1/31, 1/49, 1/71, 1/97, 2/7, 2/23, 2/47, 2/79, 8, 8/17, 8/41, 8/73, 9/23, 9/41, 9/89, 18/7, 18/31, 25/7, 25/47, 25/73, 32/17, 32/49, 32/89, 49, 49/23, 49/79, 50/31, 50/71, 72/49, 72/97, 81/17, 81/47, 98/23, 98/71]
66
1.3610780239105225