[go: up one dir, main page]

login
A138806
Expansion of (theta_3(q) * theta_3(q^27) + theta_2(q) * theta_2(q^27) - 1) / 2 in powers of q.
3
1, 0, 0, 1, 0, 0, 2, 0, 3, 0, 0, 0, 2, 0, 0, 1, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 3, 2, 0, 0, 2, 0, 0, 0, 0, 3, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 3, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 6, 1, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 2, 0, 0, 1, 0, 0, 2, 0, 0
OFFSET
1,7
COMMENTS
Half the number of integer solutions to x^2 + x*y + 7*y^2 = n. - Jianing Song, Nov 20 2019
FORMULA
a(n) is multiplicative and a(3^e) = 3 if e>1, a(p^e) = e+1 if p == 1 (mod 6), a(p^e) = (1 + (-1)^e) / 2 if p == 5 (mod 6).
a(3*n + 2) = a(4*n + 2) = 0.
G.f.: (Sum_{i,j} x^(i*i + i*j + 7*j*j) - 1) / 2.
A138805(n) = 2 * a(n) unless n=0. A033687(n) = a(3*n + 1). A097195(n) = a(6*n + 1). A123884(n) = a(12*n + 1). 2 * A121361(n) = a(12*n + 7).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = Pi/(3*sqrt(3)) = 0.604599... (A073010). - Amiram Eldar, Nov 16 2023
EXAMPLE
q + q^4 + 2*q^7 + 3*q^9 + 2*q^13 + q^16 + 2*q^19 + q^25 + 3*q^27 + ...
MATHEMATICA
f[p_, e_] := If[Mod[p, 6] == 1, e + 1, (1 + (-1)^e)/2]; f[2, e_] := 1 - Mod[e, 2]; f[3, e_] := 3; f[3, 1] = 0; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Array[a, 100] (* Amiram Eldar, Sep 07 2023 *)
PROG
(PARI) {a(n) = if( n<1, 0, if( n%3 == 2, 0, if( n%3==1, sumdiv(n, d, kronecker(-3, d)), if( n%9==0, 3 * sumdiv(n/9, d, kronecker(-3, d))))))}
(PARI) {a(n) = if( n<1, 0, sumdiv(n, d, kronecker(-3, d)) - if( n%3==0, sumdiv(n/3, d, [0, 1, -1, -3, 1, -1, 3, 1, -1][d%9+1])))}
(PARI) {a(n) = if( n<1, 0, qfrep([2, 1; 1, 14], n, 1)[n])}
CROSSREFS
Cf. A138805 (number of integer solutions to x^2 + x*y + 7*y^2 = n).
Similar sequences: A096936, A113406, A110399.
Sequence in context: A116864 A255308 A079302 * A181105 A142971 A104117
KEYWORD
nonn,easy,mult
AUTHOR
Michael Somos, Mar 30 2008
STATUS
approved