OFFSET
1,1
EXAMPLE
5 = 3^2 - 2^2.
PROG
(Python)
from sympy import primerange
from collections import Counter
def aupto(limit):
sqps = [p*p for p in primerange(1, limit//2+1)]
ways = Counter(sqps[i+1]-sqps[i] for i in range(len(sqps)-1))
return sorted(k for k in ways if k <= limit and ways[k] == 1)
print(aupto(4080)) # Michael S. Branicky, May 16 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray G. Opao, Feb 08 2004
EXTENSIONS
More terms from Ray Chandler, Feb 11 2004
STATUS
approved