A207640 Squares that can be written as a sum of 3 distinct nonzero squares in exactly two ways.
225, 361, 625, 900, 1444, 2500, 3600, 5776, 10000, 14400, 23104, 40000, 57600, 92416, 160000, 230400, 369664, 640000, 921600, 1478656, 2560000, 3686400
Offset: 1
Programs
-
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]]
Extensions
a(15)-a(22) from Robert Israel, Jan 28 2025
Comments