A263649 a(n) is multiplicative with a(2^e) = (-1)^e, a(3^e) = -2*(-1)^e if e>0, a(p^e) = e+1 if p == 1, 7 (mod 24), a(p^e) = (e+1) * (-1)^e if p == 5, 11 (mod 24), a(p^e) = (1 + (-1)^e) / 2 if p == 13, 17, 19, 23 (mod 24).
1, -1, 2, 1, -2, -2, 2, -1, -2, 2, -2, 2, 0, -2, -4, 1, 0, 2, 0, -2, 4, 2, 0, -2, 3, 0, 2, 2, -2, 4, 2, -1, -4, 0, -4, -2, 0, 0, 0, 2, 0, -4, 0, -2, 4, 0, 0, 2, 3, -3, 0, 0, -2, -2, 4, -2, 0, 2, -2, -4, 0, -2, -4, 1, 0, 4, 0, 0, 0, 4, 0, 2, 2, 0, 6, 0, -4, 0
Offset: 1
Examples
G.f. = x - x^2 + 2*x^3 + x^4 - 2*x^5 - 2*x^6 + 2*x^7 - x^8 - 2*x^9 + ...
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.
Crossrefs
Programs
-
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])];
-
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 )))};
Comments