OFFSET
0,3
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..5000
Index entries for linear recurrences with constant coefficients, signature (0,2,0,-1).
FORMULA
b(n) = -a(n) for n > 0 is multiplicative with b(2^e) = -3 * 2^(e-1) if e > 0, b(p^e) = p^e for prime p > 2.
Euler transform of length 10 sequence [-1, 3, 0, 0, 1, 0, 0, 0, 0, -1].
G.f.: (1 - x + x^2 - x^3 + x^4) / (1 - 2*x^2 + x^4).
G.f.: (1 - x) * (1 - x^10) / ((1 - x^2)^3 * (1 - x^5)).
a(n) + a(n+1) = A084964(n-1) if n>0.
EXAMPLE
G.f. = 1 - x + 3*x^2 - 3*x^3 + 6*x^4 - 5*x^5 + 9*x^6 - 7*x^7 + 12*x^8 + ...
MATHEMATICA
a[ n_] := Which[ n < 1, Boole[n == 0], OddQ[n], -n, True, 3 n/2];
a[ n_] := SeriesCoefficient[ (1 - x + x^2 - x^3 + x^4) / (1 - 2*x^2 + x^4), {x, 0, n}];
Join[{1}, LinearRecurrence[{0, 2, 0, -1}, {-1, 3, -3, 6}, 50]] (* G. C. Greubel, Aug 01 2018 *)
PROG
(PARI) {a(n) = if( n<1, n==0, n%2, -n, 3*n/2)};
(PARI) {a(n) = if( n<0, 0, polcoeff( (1 - x) * (1 - x^10) / ((1 - x^2)^3 * (1 - x^5)) + x * O(x^n), n))};
(Magma) I:=[-1, 3, -3, 6]; [1] cat [n le 4 select I[n] else 2*Self(n-2) - Self(n-4): n in [1..30]]; // G. C. Greubel, Aug 01 2018
CROSSREFS
KEYWORD
sign,easy
AUTHOR
Michael Somos, Dec 27 2016
STATUS
approved