A063730 Number of solutions to w^2 + x^2 + y^2 + z^2 = n in positive integers.
0, 0, 0, 0, 1, 0, 0, 4, 0, 0, 6, 0, 4, 4, 0, 12, 1, 0, 12, 4, 6, 4, 12, 12, 0, 12, 6, 12, 12, 0, 24, 16, 0, 12, 18, 12, 13, 16, 12, 28, 6, 0, 36, 16, 12, 24, 24, 24, 4, 16, 30, 24, 18, 12, 36, 36, 0, 28, 42, 12, 36, 16, 24, 52, 1, 24, 48, 28, 18, 24, 60, 36, 12
Offset: 0
Keywords
Links
Programs
-
Mathematica
r[n_] := Reduce[ w > 0 && x > 0 && y > 0 && z > 0 && w^2 + x^2 + y^2 + z^2 == n, {w, x, y, z}, Integers]; a[n_] := Which[rn = r[n]; rn === False, 0, Head[rn] === Or, Length[rn], True, 1]; Table[a[n], {n, 0, 72}] (* Jean-François Alcover, Jul 22 2013 *) a[n_ ] := Length[FindInstance[{n == w^2 + x^2 + y^2 + z^2, w > 0, x > 0, y > 0, z > 0}, {w, x, y, z}, Integers, 10^18]]; (* Michael Somos, Jun 23 2023 *)
-
PARI
seq(n)=Vec((sum(k=1, sqrtint(n), x^(k^2)) + O(x*x^n))^4 + O(x*x^n), -(n+1)) \\ Andrew Howroyd, Aug 08 2018
Formula
G.f.: (Sum_{m>=1} x^(m^2))^4.
a(n) = ( A000118(n) - 4*A005875(n) + 6*A004018(n) - 4*A000122(n) + A000007(n) )/16. - Max Alekseyev, Sep 29 2012
G.f.: ((theta_3(q) - 1)/2)^4, where theta_3() is the Jacobi theta function. - Ilya Gutkovskiy, Aug 08 2018