OFFSET
1,7
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..10000
FORMULA
G.f.: Sum_{n >= 1} -(-1)^n * q^(n*(n+1)/2)*(1-q)*(1-q^2)*...*(1-q^(n-1))/ ((1+q)*(1+q^2)*...*(1+q^n)). - Jeremy Lovejoy, Jun 12 2009
a(4*n) = A035185(n). a(8*n + 3) = a(8*n + 5) = 0.
EXAMPLE
G.f. = x - x^2 + x^4 - 2*x^7 + x^8 + x^9 - 2*x^14 + x^16 + 2*x^17 - x^18 + ...
MATHEMATICA
a[ n_] := If[ n < 1, 0, (-1)^Quotient[n, 2] DivisorSum[ n, KroneckerSymbol[ 2, #]&]];
a[ n_] := If[ n < 1, 0, I^(1 - n) Times @@ ( Which[ # == 1, 1, # == 2, -I, Mod[#, 8] > 1 && Mod[#, 8] < 7, 1 - Mod[#2, 2], True, #2 + 1] & @@@ FactorInteger @ n)];
PROG
(PARI) {a(n) = if( n<1, 0, (-1)^(n\2) * sumdiv( n, d, kronecker( 2, d)))};
(PARI) {a(n) = my(A, p, e); if( n<1, 0, A = factor(n); I^(1-n) * prod(k=1, matsize(A)[1], [p, e] = A[k, ]; if(p==2, -I, p%8>1 && p%8<7, !(e%2), e+1)))};
CROSSREFS
KEYWORD
sign
AUTHOR
Michael Somos, Jul 06 2015
STATUS
approved