OFFSET
0,4
COMMENTS
Note that a(n)=0 for n=0 and the n in A094958.
LINKS
Robert Israel, Table of n, a(n) for n = 0..2000
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