%I #63 Dec 16 2023 09:02:20
%S 1,2,4,0,6,0,0,2,8,2,0,4,0,0,4,0,10,0,4,0,0,0,8,4,0,2,0,0,6,4,0,0,12,
%T 0,0,0,6,4,0,0,0,0,0,4,12,0,8,0,0,2,4,0,0,4,0,0,8,0,8,0,0,0,0,2,14,0,
%U 0,4,0,0,0,4,8,0,8,0,0,4,0,4,0,2,0,0,0,0,8,0,16,0,0,0,12,0,0,0,0,0,4,4,6,0
%N Theta series of Kleinian lattice Z[(1 + sqrt(-7))/ 2] in 1 complex (or 2 real) dimensions.
%C In other words, theta series of lattice with Gram matrix [2, 1; 1, 4].
%C The number of integer solutions (x, y) to x^2 + x*y + 2*y^2 = n.
%C Ramanujan theta functions: f(q) (see A121373), phi(q) (A000122), psi(q) (A010054), chi(q) (A000700).
%D Bruce C. Berndt, Ramanujan's Notebooks Part III, Springer-Verlag, 1991, see p. 467, Entry 5(i).
%H John Cannon, <a href="/A002652/b002652.txt">Table of n, a(n) for n = 0..5000</a>
%H J. H. Conway and N. J. A. Sloane, <a href="http://dx.doi.org/10.1090/S0002-9947-1983-0716832-0">Complex and integral laminated lattices</a>, Trans. Amer. Math. Soc., 280 (1983), 463-490.
%H N. J. A. Sloane et al., <a href="https://oeis.org/wiki/Binary_Quadratic_Forms_and_OEIS">Binary Quadratic Forms and OEIS</a> (Index to related sequences, programs, references).
%H Michael Somos, <a href="/A010815/a010815.txt">Introduction to Ramanujan theta functions</a>, 2019.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/RamanujanThetaFunctions.html">Ramanujan Theta Functions</a>.
%F G.f.: theta_3(q) * theta_3(q^7) + theta_2(q) * theta_2(q^7).
%F G.f.: 1 + 2 * Sum_{k>0} Kronecker(-7, k) * x^k / (1 - x^k). - _Michael Somos_, Mar 17 2012
%F Expansion of phi(x) * phi(x^7) + 4 * x^2 * psi(x^2) * psi(x^14) = phi(-x) * phi(-x^7) + 4 * x * psi(x) * psi(x^7) in powers of x where phi(), psi() are Ramanujan theta functions. - _Michael Somos_, Mar 17 2012
%F Expansion of ((eta(q) * eta(q^7))^3 + 4 * (eta(q^2) * eta(q^14))^3) / (eta(q) * eta(q^2) * eta(q^7) * eta(q^14)) in powers of q. - _Michael Somos_, May 28 2005
%F Moebius transform is period 7 sequence [ 2, 2, -2, 2, -2, -2, 0, ...]. - _Michael Somos_, Oct 07 2005
%F G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^4)) where f(u, v, w) = u^2 + 5 * v^2 + 4 * w^2 + 2 * u*w - 4 * u*v - 8 * v*w. - _Michael Somos_, Sep 20 2004
%F G.f. A(x) satisfies 0 = f(A(x), A(x^2), A(x^3), A(x^6)) where f(u1, u2, u3, u6) = u1^3*u6 + 2*u2^3*u3 + 18*u1*u3*u6^2 + 18*u2*u3^2*u6 + 6*u1*u2^2*u6 + 3*u1^2*u2*u3 - 3*u2*u3^3 - 18*u2*u3*u6^2 - 6*u1*u6^3 - 9*u1*u3^2*u6 - 6*u1*u2^2*u3 - 6*u1^2*u2*u6. - _Michael Somos_, Jun 03 2005
%F From _Michael Somos_, Mar 17 2012: (Start)
%F G.f. is a period 1 Fourier series which satisfies f(-1 / (7 t)) = 7^(1/2) (t/i) f(t) where q = exp(2 Pi i t).
%F a(n) = 2 * A035182(n) unless n = 0. a(7*n + 5) = a(7*n + 6) = a(9*n + 3) = a(9*n + 6) = 0. a(2*n + 1) = 2 * A133827(n). a(9*n) = a(n). (End)
%F a(0) = 1, a(n) = 2 * b(n) for n > 0, where b() is multiplicative with b(7^e) = 1, b(p^e) = e + 1 if p == 1, 2, 4 (mod 7), b(p^e) = (1 + (-1)^e) / 2 if p == 3, 5, 6 (mod 7). - _Michael Somos_, Jun 10 2015
%F Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=0..m} a(k) = 2*Pi/sqrt(7) = 2.3748208... . - _Amiram Eldar_, Dec 16 2023
%e G.f. = 1 + 2*x + 4*x^2 + 6*x^4 + 2*x^7 + 8*x^8 + 2*x^9 + 4*x^11 + 4*x^14 + ...
%e Theta series of lattice with Gram matrix [2, 1; 1, 4] = 1 + 2*q^2 + 4*q^4 + 6*q^8 + 2*q^14 + 8*q^16 + 2*q^18 + 4*q^22 + 4*q^28 + 10*q^32 + 4*q^36 + 8*q^44 + 4*q^46 + 2*q^50 + 6*q^56 + 4*q^58 + 12*q^64 + 6*q^72 + ...
%t f[d_] := KroneckerSymbol[-7, d]; a[n_] := 2*Total[f /@ Divisors[n]]; a[0]=1; Table[a[n], {n, 0, 101}] (* _Jean-François Alcover_, Nov 08 2011, after Michael Somos *)
%t a[ n_] := If[ n < 1, Boole[n == 0], 2 Sum[ KroneckerSymbol[ -7, d], { d, Divisors[ n]}]]; (* _Michael Somos_, Jun 10 2015 *)
%t a[ n_] := If[ n < 1, Boole[n == 0], 2 DivisorSum[ n, KroneckerSymbol[ -7, #] &]]; (* _Michael Somos_, Jun 10 2015 *)
%t a[ n_] := If[ n < 1, Boole[n == 0], Length @ FindInstance[ n == x^2 + x y + 2 y^2, {x, y}, Integers, 10^9]]; (* _Michael Somos_, Jun 10 2015 *)
%o (PARI) {a(n) = my(t2, t3); if( n<1, n==0, t2 = 2 * sum( n=1, (sqrtint( max(0, 4*n - 7)) + 1)\2, x^(n*n - n)); t3 = 1 + 2 * sum( n=1, sqrtint(n), x^(n*n)); polcoeff( t3 * subst(t3, x, x^7) + x^2 * t2 * subst(t2, x, x^7), n))};
%o (PARI) {a(n) = my(t); if( n<1, n==0, 2 * issquare(n) + 2 * sum( y=1, sqrtint(n*4\7), 2 * issquare(t = 4*n - 7*y^2) - (t==0)))}; /* _Michael Somos_, Sep 20 2004 */
%o (PARI) {a(n) = my(A, A1, A2); if( n<0, 0, A = x * O(x^n); A1 = eta(x + A) * eta(x^7 + A); A2 = eta(x^2 + A) * eta(x^14 + A); polcoeff( (A1^3 + 4 * x * A2^3) / (A1 * A2), n))}; /* _Michael Somos_, May 28 2005 */
%o (PARI) {a(n) = if( n<1, n==0, 2 * qfrep( [ 2, 1; 1, 4], n, 1)[n])}; /* _Michael Somos_, Jun 03 2005 */
%o (PARI) {a(n) = if( n<1, n==0, 2 * sumdiv( n, d, kronecker( -7, d)))}; /* _Michael Somos_, Oct 07 2005 */
%o (Magma) A := Basis( ModularForms( Gamma1(14), 1), 85); A[1] + 2*A[2] + 4*A[3] + 6*A[5]; /* _Michael Somos_, Jun 10 2015 */
%Y Cf. A035182, A133827, A028951.
%Y Cf. A000122, A000700, A010054, A121373.
%Y Number of integer solutions to f(x,y) = n where f(x,y) is the principal binary quadratic form with discriminant d: A004016 (d=-3), A004018 (d=-4), this sequence (d=-7), A033715 (d=-8), A028609 (d=-11), A028641 (d=-19), A138811 (d=-43).
%K nonn,easy,nice
%O 0,2
%A _N. J. A. Sloane_