Least number k such that k^2 + n^2 is a square, or zero if no such square exists.

0, 0, 4, 3, 12, 8, 24, 6, 12, 24, 60, 5, 84, 48, 8, 12, 144, 24, 180, 15, 20, 120, 264, 7, 60, 168, 36, 21, 420, 16, 480, 24, 44, 288, 12, 15, 684, 360, 52, 9, 840, 40, 924, 33, 24, 528, 1104, 14, 168, 120, 68, 39, 1404, 72, 48, 33, 76, 840, 1740, 11, 1860, 960

1

Only s(1) and s(2) are zero. The record values (p^2-1)/2 occur at the odd primes p. In the plot above, the next lower curve is formed by numbers that are two times a prime and we have s(2p) = p^2-1.

T. D. Noe, Plot of 1000 terms

T. D. Noe, Table of 1000 terms

Eric W. Weisstein, MathWorld: Pythagorean Triple

(Mma) PerfectSquareQ[n_] := JacobiSymbol[n, 13] =!= -1 && JacobiSymbol[n, 19] =!= -1 && JacobiSymbol[n, 17] =!= -1 && JacobiSymbol[n, 23] =!= -1 && IntegerQ[Sqrt[n]]; nn = 100; Join[{0, 0}, Table[s = Select[Range[nn^2], PerfectSquareQ[a^2 + #^2] &, 1]; If[s == {}, 0, s[[1]]], {a, 3, nn}]]

Cf. S000625.

nonn

T. D. Noe, May 12 2015