OFFSET
1,1
COMMENTS
k is a term if and only if 4*k is a term. Are 225, 361 and 625 the only terms not divisible by 4? - Robert Israel, Jan 28 2025
MAPLE
N:= 1000; # for squares up to N^2
V:= Vector(N):
for x from 1 to N-1 do
for y from 1 to x-1 while x^2 + y^2 < N^2 do
for z from 1 to y-1 do
s:= x^2 + y^2 + z^2;
if s > N^2 then break fi;
if issqr(s) then
v:= sqrt(s);
V[v]:= V[v]+1
fi
od od od:
map(`^`, select(t -> V[t]=2, [$1..N]), 2); # Robert Israel, Jan 28 2025
MATHEMATICA
t = Sort[Select[Flatten[Table[x^2 + y^2 + z^2, {x, 400}, {y, x + 1, 400}, {z, y + 1, 400}]], # < 160006 && IntegerQ[Sqrt[#]] &]];
f1[l_] := Module[{t = {}}, Do[If[l[[n]] != l[[n + 1]] && l[[n]] != l[[n - 1]], AppendTo[t, l[[n]]]], {n, Length[l] - 1}]; t];
f2[l_] := Module[{t = {}}, Do[If[l[[n]] == l[[n + 1]], AppendTo[t, l[[n]]]], {n, Length[l] - 1}]; t];
s1 = Join[{First[t]}, f1[t]];
Complement[t, s1];
t = f2[t];
s2 = Join[{First[t]}, f1[t]]
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Vladimir Joseph Stephan Orlovsky, Feb 19 2012
EXTENSIONS
a(15)-a(22) from Robert Israel, Jan 28 2025
STATUS
approved