OFFSET
1,1
LINKS
MAPLE
N:= 10^6;
A:= Vector(N):
for a from 1 to floor(sqrt(N/3)) do
for b from a+1 to floor(sqrt((N-a^2)/2)) do
c:= [$(b+1) .. floor(sqrt(N-a^2-b^2))]:
v:= map(t -> a^2 + b^2 + t^2, c):
A[v]:= map(`+`, A[v], 1)
od od:
select(t -> A[t]=2, [$1..N]); # Robert Israel, Jan 03 2016
MATHEMATICA
upperbound = 10^4; max = Floor@Sqrt@upperbound;
range = ConstantArray[0, 3*max^2];
++range[[#]]&/@(Plus@@#&/@Subsets[Range@max^2, {3}]);
Select[Flatten@Position[range, 2], # <= upperbound &] (* Hans Rudolf Widmer, Aug 04 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved