OFFSET
1,3
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..1000
Michael Somos, Introduction to Ramanujan theta functions, 2019.
Eric Weisstein's World of Mathematics, Ramanujan Theta Functions.
FORMULA
EXAMPLE
G.f. = x - x^2 + 2*x^3 + x^4 - 2*x^5 - 2*x^6 + 2*x^7 - x^8 - 2*x^9 + ...
MATHEMATICA
a[ n_] := If[ n < 1, 0, Times @@ (Which[ # < 4, {-1, 1, -2}[[#]] (-1)^#2, Mod[#, 24] < 12, (#2 + 1) KroneckerSymbol[ #, 12]^#2, True, 1 - Mod[#2, 2]]& @@@ FactorInteger[n])];
PROG
(PARI) {a(n) = my(A, p, e); if( n<1, 0, A = factor(n); prod(k=1, matsize(A)[1], [p, e] = A[k, ]; if( p==2, (-1)^e, p==3, -2 * (-1)^e, p%24>12, 1-e%2, (e+1) * kronecker(p, 12)^e )))};
CROSSREFS
KEYWORD
sign,mult
AUTHOR
Michael Somos, Oct 22 2015
STATUS
approved