OFFSET
0,3
FORMULA
a(n) is multiplicative with a(2) = 1, a(2^e) = 0 if e>1, a(3) = -1, a(3^e) = 4 * (-1)^e if e>1, a(p^e) = 1 if p == 1 (mod 4), a(p^e) = (-1)^e if p == 3 (mod 4).
a(n) = -a(-n) = a(n+72) = a(n+36)*(-1)^(mod(n,4)=2) for all n in Z.
0 = a(n) + a(n+18) + a(n+36) + a(n+54) for all n in Z.
Sum_{d|n} a(d) * (-1)^(n+d) = A258256(n) if n>0.
Sum_{k=1..n} abs(a(k)) ~ (4/3) * n. - Amiram Eldar, Jan 28 2024
EXAMPLE
G.f. = x + 2*x^2 - x^3 + x^5 - 2*x^6 - x^7 + 4*x^9 + 2*x^10 - x^11 + ...
MATHEMATICA
a[ n_] := {1, 2, -1, 0}[[Mod[n, 4, 1]]] If[ Divisible[ n, 9], 4, 1] (-1)^Boole[Mod[n, 8] == 6];
a[ n_] := With[ {m = Mod[n, 72], f = #/(1 + #^2) &}, SeriesCoefficient[ f[x] + 2 f[x^2] + 3 f[x^9] + 6 f[x^18], {x, 0, m}]];
PROG
(PARI) {a(n) = [0, 1, 2, -1][n%4 + 1] * if(n%9, 1, 4) * (-1)^(n%8==6)};
CROSSREFS
KEYWORD
sign,easy,mult
AUTHOR
Michael Somos, May 24 2015
STATUS
approved