login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A259829
a(n) = (-1)^floor(n/2) * A035185(n).
2
1, -1, 0, 1, 0, 0, -2, 1, 1, 0, 0, 0, 0, -2, 0, 1, 2, -1, 0, 0, 0, 0, -2, 0, 1, 0, 0, 2, 0, 0, -2, 1, 0, -2, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, -2, -2, 0, 3, -1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, -2, -2, 1, 0, 0, 0, 2, 0, 0, -2, 1, 2, 0, 0, 0, 0, 0, -2, 0, 1, -2
OFFSET
1,7
LINKS
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
Cf. A035185.
Sequence in context: A351358 A138158 A057276 * A035185 A339659 A338971
KEYWORD
sign
AUTHOR
Michael Somos, Jul 06 2015
STATUS
approved