login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A181787
Number of solutions to n^2 = a^2 + b^2 + c^2 with positive a, b, c.
4
0, 0, 0, 3, 0, 0, 3, 6, 0, 12, 0, 9, 3, 6, 6, 15, 0, 9, 12, 15, 0, 33, 9, 18, 3, 12, 6, 39, 6, 18, 15, 24, 0, 48, 9, 30, 12, 24, 15, 45, 0, 27, 33, 33, 9, 60, 18, 36, 3, 48, 12, 60, 6, 36, 39, 45, 6, 78, 18, 45, 15, 42, 24, 114, 0, 36, 48, 51, 9, 93, 30, 54, 12, 51, 24, 87, 15, 87, 45, 60, 0, 120, 27, 63, 33, 51, 33, 105, 9, 63, 60, 84, 18, 123, 36, 75, 3, 69, 48, 165, 12
OFFSET
0,4
COMMENTS
Note that a(n)=0 for n=0 and the n in A094958.
LINKS
FORMULA
a(n) = A063691(n^2). - Michel Marcus, Apr 25 2015
a(2*n) = a(n). - Robert Israel, Aug 02 2019
EXAMPLE
a(3)=3 because 3^2 = 1^2+2^2+2^2 = 2^2+1^2+2^2 = 2^2+2^2+1^2. - Robert Israel, Aug 02 2019
MAPLE
N:= 200: # for a(0)..a(N)
A:= Array(0..N):
mults:= [1, 3, 6]:
for a from 1 while 3*a^2 <= N^2 do
if a::odd then b0:= a+1; db:= 2 else b0:= a; db:= 1 fi;
for b from b0 by db while a^2 + 2*b^2 <= N^2 do
if (a+b)::odd then c0:= b + (b mod 2); dc:= 2 else c0:= b; dc:= 1 fi;
for c from c0 by dc do
v:= a^2 + b^2 + c^2;
if v > N^2 then break fi;
if issqr(v) then
w:= sqrt(v);
A[w]:= A[w]+ mults[nops({a, b, c})];
fi
od od od:
convert(A, list); # Robert Israel, Aug 02 2019
MATHEMATICA
nn=100; t=Table[0, {nn}]; Do[n=Sqrt[a^2+b^2+c^2]; If[n<=nn && IntegerQ[n], t[[n]]++], {a, nn}, {b, nn}, {c, nn}]; Prepend[t, 0]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
T. D. Noe, Nov 12 2010
STATUS
approved