OFFSET
0,2
COMMENTS
This counts ordered sums of squares of nonnegative integers, whereas A000118 counts ordered sums of squares of integers of any sign. - R. J. Mathar, May 16 2023
LINKS
FORMULA
Coefficient of q^n in (1/16)*(1 + theta_3(0, q))^4; or coeff. of q^n in (Sum_{i>=0} q^(i^2))^4.
EXAMPLE
From R. J. Mathar, May 16 2023: (Start)
a(1)=4 counts 0^2+0^2+0^2+1^2 = 0^2+0^2+1^2+0^2 = 0^2+1^2+0^2+0^2 = 1^2+0^2+0^2+0^2.
a(2)=6 counts 0^2+0^2+1^2+1^2 = 0^2+1^2+0^2+1^2 = 0^2+1^2+1^2+0^2 = 1^2+0^2+0^2+1^2 = 1^2+0^2+1^2+0^2 = 1^2+1^2+0^2+0^2. (End)
MATHEMATICA
a = Compile[{{n, _Integer}}, Block[{c = 0, k, j, i = Floor[Sqrt[n]]}, While[i > -1, j = Floor[Sqrt[n - i^2]]; While[j > -1, k = Floor[Sqrt[n - i^2 - j^2]]; While[k > -1, c += Boole[ Mod[ Sqrt[ n - i^2 - j^2 - k^2], 1] == 0]; k--]; j--]; i--]; c]]; Array[a, 70, 0] (* Robert G. Wilson v, Aug 13 2025 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Joe Keane (jgk(AT)jgk.org)
STATUS
approved
