%I #30 Nov 24 2023 08:10:15
%S 1,0,1,2,0,2,1,0,0,2,0,0,3,0,2,2,0,0,2,0,1,0,0,2,2,0,0,2,0,2,1,0,2,4,
%T 0,0,0,0,0,2,0,0,3,0,0,2,0,2,2,0,2,0,0,0,4,0,1,2,0,2,2,0,0,0,0,0,0,0,
%U 4,2,0,0,1,0,0,4,0,2,2,0,0,2,0,2,2,0,0,2,0,0,3,0,0,2,0,2,0,0,0,2,0,0,2,0,2
%N Number of representations of n as a sum of three times a square and two times a triangular number.
%C Ramanujan theta functions: f(q) := Prod_{k>=1} (1-(-q)^k) (see A121373), phi(q) := theta_3(q) := Sum_{k=-oo..oo} q^(k^2) (A000122), psi(q) := Sum_{k=0..oo} q^(k*(k+1)/2) (A010054), chi(q) := Prod_{k>=0} (1+q^(2k+1)) (A000700).
%C Number of representations of 2n as a sum of three times a triangular number and a triangular number.
%H G. C. Greubel, <a href="/A112604/b112604.txt">Table of n, a(n) for n = 0..1000</a>
%H M. D. Hirschhorn, <a href="http://dx.doi.org/10.1016/j.disc.2004.08.045">The number of representations of a number by various forms</a>, Discrete Mathematics 298 (2005), 205-211.
%H Michael Somos, <a href="/A010815/a010815.txt">Introduction to Ramanujan theta functions</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RamanujanThetaFunctions.html">Ramanujan Theta Functions</a>
%F a(n) = A002324(4n+1) = A033762(2n) = d_{1, 3}(4n+1) - d_{2, 3}(4n+1) where d_{a, m}(n) equals the number of divisors of n which are congruent to a mod m.
%F From _Michael Somos_, Feb 14 2006: (Start)
%F Expansion of (psi(q)psi(q^3) + psi(-q)psi(-q^3))/2 in powers of q^2 where psi() is a Ramanujan theta function.
%F G.f.: (Sum_{k} x^k^2)^3*(Sum_{k>0} x^((k^2-k)/2))^2 = Product_{k>0} (1-x^(4k))(1-x^(6k))(1+x^(2k))(1+x^(3k))^2/(1+x^(6k))^2.
%F Euler transform of period 12 sequence [0, 1, 2, -1, 0, -2, 0, -1, 2, 1, 0, -2, ...]. (End)
%F From _Michael Somos_, Aug 11 2009: (Start)
%F G.f. is a period 1 Fourier series which satisfies f(-1 / (48 t)) = 3^(1/2) (t/i) g(t) where q = exp(2 Pi i t) and g() is g.f. for A164272.
%F a(3*n + 1) = 0. (End)
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/(2*sqrt(3)) = 0.906899... (A093766). - _Amiram Eldar_, Nov 24 2023
%e a(12) = 3 since we can write 12 = 3(2)^2 + 0 = 3(-2)^2 + 0 = 0 + 2*6.
%e 2*12 = 24 = 3*1+21 = 3*3+15 = 3*6+6 so a(12) = 3.
%e G.f. = 1 + x^2 + 2*x^3 + 2*x^5 + x^6 + 2*x^9 + 3*x^12 + 2*x^14 + 2*x^15 + ... - _Michael Somos_, Aug 11 2009
%e G.f. = q + q^9 + 2*q^13 + 2*q^21 + q^25 + 2*q^37 + 3*q^49 + 2*q^57 + 2*q^61 + ... - _Michael Somos_, Aug 11 2009
%t a[n_] := DivisorSum[4n+1, Switch[Mod[#, 3], 1, 1, 2, -1, 0, 0]&]; Table[ a[n], {n, 0, 104}] (* _Jean-François Alcover_, Dec 04 2015, adapted from PARI *)
%o (PARI) {a(n) = if(n<0, 0, n=4*n+1; sumdiv(n, d, (d%3==1) - (d%3==2)))};
%o (PARI) {a(n) = my(A); if(n<0, 0, A=x*O(x^n); polcoeff( eta(x^6+A)^5 / eta(x^2+A)*(eta(x^4+A) / eta(x^3+A) / eta(x^12+A))^2, n))}; /* _Michael Somos_, Feb 14 2006 */
%Y A112606(n) = a(2*n). 2 * A112607(n) = a(2*n + 1). A123884(n) = a(3*n). A112605(n) = a(3*n + 2). A131961(n) = a(6*n). A112608(n) =a(6*n + 2). 2 * A131963(n) = a(6*n + 3). 2 * A112609(n) = a(6*n + 5). - _Michael Somos_, Aug 11 2009
%Y Cf. A002324, A033762, A093766, A164272.
%Y Cf. A000700, A000122, A010054, A121373.
%K nonn
%O 0,4
%A _James A. Sellers_, Dec 21 2005