login
Numbers that are the sum of 3 distinct nonzero squares in exactly 2 ways.
1

%I #19 Aug 22 2021 17:23:49

%S 62,69,74,77,86,89,90,94,98,105,117,122,125,129,131,138,141,150,154,

%T 155,158,165,166,170,179,181,195,197,201,203,210,213,217,218,225,227,

%U 229,233,238,241,242,246,248,249,250,259,273,274,275,276,282,296,297,301,308,310

%N Numbers that are the sum of 3 distinct nonzero squares in exactly 2 ways.

%H Robert Israel, <a href="/A025340/b025340.txt">Table of n, a(n) for n = 1..1777</a>

%H <a href="/index/Su#ssq">Index entries for sequences related to sums of squares</a>

%p N:= 10^6;

%p A:= Vector(N):

%p for a from 1 to floor(sqrt(N/3)) do

%p for b from a+1 to floor(sqrt((N-a^2)/2)) do

%p c:= [$(b+1) .. floor(sqrt(N-a^2-b^2))]:

%p v:= map(t -> a^2 + b^2 + t^2, c):

%p A[v]:= map(`+`,A[v],1)

%p od od:

%p select(t -> A[t]=2,[$1..N]); # _Robert Israel_, Jan 03 2016

%t upperbound = 10^4; max = Floor@Sqrt@upperbound;

%t range = ConstantArray[0, 3*max^2];

%t ++range[[#]]&/@(Plus@@#&/@Subsets[Range@max^2,{3}]);

%t Select[Flatten@Position[range, 2], # <= upperbound &] (* _Hans Rudolf Widmer_, Aug 04 2021 *)

%Y Subsequence of A004432. Subsequence of A024804.

%K nonn

%O 1,1

%A _David W. Wilson_