OFFSET
1,1
EXAMPLE
5^2 = 25 = 3^2 + 4^2; 6^2 = 3^2 + 3^3; 9^2 = 2^5 + 7^2, ...
PROG
(PARI) is(n)=for(i=2, (n^2-1)\2, ispower(i)&&ispower(n^2-i)&&return(i))) \\ For more efficiency, loop over elements of precomputed A001597\{1}.
(PARI) L=100; PP=List(); a=Set(); for(n=1, L^2, ispower(n)||next; for(i=1, #PP, issquare(n+PP[i], &m)&& m<=L&& a=setunion(a, [m])); listput(PP, n)); a
CROSSREFS
KEYWORD
nonn
AUTHOR
M. F. Hasler, May 13 2018
STATUS
approved