OFFSET
0,4
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..10000
Michael Somos, Introduction to Ramanujan theta functions
Eric Weisstein's World of Mathematics, Ramanujan Theta Functions
FORMULA
EXAMPLE
G.f. = 1 + x - 2*x^3 + x^4 - 2*x^6 + 2*x^9 - 2*x^10 + x^12 + x^13 + ...
G.f. = q + q^3 - 2*q^7 + q^9 - 2*q^13 + 2*q^19 - 2*q^21 + q^25 + ...
MATHEMATICA
a[ n_] := If[ n < 0, 0, {1, 1, -1, 1, 1, -1, -1, 1, 1, -1, 1, 1}[[Mod[n, 12, 1]]] DivisorSum[ 2 n + 1, KroneckerSymbol[ -3, #] &]];
a[ n_] := SeriesCoefficient[ (EllipticTheta[ 4, 0, x^6] EllipticTheta[ 2, 0, x^2] + EllipticTheta[ 4, 0, x^2] EllipticTheta[ 2, 0, x^6]) / (2 x^(1/2)), {x, 0, n}];
a[ n_] := If[ n < 0, 0, Times @@ (Which[ # < 5, Mod[#, 2], Mod[#, 6] == 5, 1 - Mod[#2, 2], True, (#2 + 1) KroneckerSymbol[ 6, #]^#2] & @@@ FactorInteger @ (2 n + 1))];
PROG
(PARI) {a(n) = my(A, p, e); if( n<0, 0, A = factor(2*n + 1); prod(k=1, matsize(A)[1], [p, e] = A[k, ]; if( p<5, p%2, p%6 == 1, (e+1) * if( p%24 == 1 || p%24 == 19, 1, (-1)^e), 1-e%2 )))};
CROSSREFS
KEYWORD
sign
AUTHOR
Michael Somos, Oct 01 2015
STATUS
approved