2. The following is a much more productive SageMath/Python code due to Gerry Myerson's idea to convert to a hyperbola. ```Python 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: t = QQ(n) / QQ(d) a = t^2 / (r - t^2) 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) ``` ```output [<12174 values of a, instead of original 66>] 12174 0.7950456142425537 ```