|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Note that a(n)=0 for n=0 and the n in A094958.
|
|
LINKS
|
|
|
FORMULA
|
|
|
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:
|
|
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
|
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|