OFFSET
1,1
LINKS
T. D. Noe, Table of n, a(n) for n=1..908
EXAMPLE
5 = 3^2 - 2^2.
MATHEMATICA
With[{nn=100}, Take[Sort[Transpose[Select[Tally[Last[#]-First[#]&/@ Subsets[ Prime[Range[nn]]^2, {2}]], Last[#]==1&]][[1]]], nn]] (* Harvey P. Dale, Apr 05 2014 *)
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(b-a for i, a in enumerate(sqps) for b in sqps[i+1:])
return sorted(k for k in ways if k <= limit and ways[k] == 1)
print(aupto(2328)) # Michael S. Branicky, May 16 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray Chandler, Feb 14 2004
STATUS
approved