OFFSET
0,3
COMMENTS
This is a divisibility sequence.
LINKS
Index entries for linear recurrences with constant coefficients, signature (0,0,-2,0,0,-1).
FORMULA
Euler transform of length 10 sequence [-1, 2, -2, -1, 1, 2, 0, 0, 0, -1]. - Michael Somos, Dec 29 2016
a(n) = -b(n) where b() is multiplicative with b(2^e) = -(2^e) if e>0, b(3^e) = 4*3^(e-1) if e>0, a(p^e) = p^e otherwise.
G.f.: 1 - x / (1 + x)^2 - x^3 / (1 + x^3)^2.
G.f.: (1 + x^2) * (1 + x^5) / ((1 + x) * (1 + x^3)^2).
G.f.: (1 - x) * (1 - x^3)^2 * (1 - x^4) * (1 - x^10) / ((1 - x^2)^2 * (1 - x^5) * (1 - x^6)^2).
a(n) = (-1)^n * A257174(n).
EXAMPLE
G.f. = 1 - x + 2*x^2 - 4*x^3 + 4*x^4 - 5*x^5 + 8*x^6 - 7*x^7 + 8*x^8 + ...
MATHEMATICA
a[ n_] := If[ n < 1, Boole[n == 0], (-1)^n n If[ Mod[n, 3] > 0, 1, 4/3]];
a[ n_] := If[ n < 0, 0, SeriesCoefficient[ (1 + x^2) (1 + x^5) / ((1 + x) (1 + x^3)^2), {x, 0, n}]];
PROG
(PARI) {a(n) = if( n<1, n==0, (-1)^n * n * if( n%3, 1, 4/3))};
(PARI) {a(n) = if( n<0, 0, polcoeff( (1 + x^2) * (1 + x^5) / ((1 + x) * (1 + x^3)^2) + x * O(x^n), n))};
(PARI) {a(n) = if( n<0, 0, polcoeff( (1 - x) * (1 - x^3)^2 * (1 - x^4) * (1 - x^10) / ((1 - x^2)^2 * (1 - x^5) * (1 - x^6)^2) + x * O(x^n), n))};
(Magma) m:=50; R<x>:=PowerSeriesRing(Integers(), m); Coefficients(R!((1 + x^2)*(1+x^5)/((1+x)*(1+x^3)^2))); // G. C. Greubel, Jul 29 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Michael Somos, Dec 29 2016
STATUS
approved