OFFSET
0,3
COMMENTS
LINKS
Michael Somos, Rational Function Multiplicative Coefficients
Index entries for linear recurrences with constant coefficients, signature (0,-1,0,-1)
FORMULA
Euler transform of length 6 sequence [2, -3, 0, 0, 0, 1].
a(n) is multiplicative with a(2^e) = -2 * (-1)^e if e>0. a(3^e) = 0^e, a(p^e) = 1 if p == 1 (mod 6), a(p^e) = (-1)^n if p == 5 (mod 6).
G.f.: x * (1 + x)^2 / (1 + x^2 + x^4). a(n+3) = a(-n) = -a(n). a(n) = n if |n| < 3.
a(n) = (mod(n+1, 3) - 1) * (mod(n+1, 2) + 1) * (-1)^(n+1). - Wesley Ivan Hurt, Aug 31 2014
|a(n)| = A193680(n). - Wesley Ivan Hurt, Aug 31 2014
EXAMPLE
G.f. = x + 2*x^2 - 2*x^4 - x^5 + x^7 + 2*x^8 - 2*x^10 - x^11 + x^13 + ...
MAPLE
A186809:=n->(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1): seq(A186809(n), n=0..100); # Wesley Ivan Hurt, Aug 31 2014
MATHEMATICA
Table[(Mod[n + 1, 3] - 1) (Mod[n + 1, 2] + 1) (-1)^(n + 1), {n, 0, 100}] (* Wesley Ivan Hurt, Aug 31 2014 *)
PadRight[{}, 120, {0, 1, 2, 0, -2, -1}] (* Harvey P. Dale, Nov 18 2020 *)
PROG
(PARI) {a(n) = [0, 1, 2, 0, -2, -1][n%6 + 1]};
(Magma) [(((n+1) mod 3)-1)*(((n+1) mod 2)+1)*(-1)^(n+1) : n in [0..100]]; // Wesley Ivan Hurt, Aug 31 2014
(Haskell)
a186809 n = a186809_list !! (n-1)
a186809_list = cycle [0, 1, 2, 0, -2, -1]
-- Reinhard Zumkeller, Oct 19 2015
CROSSREFS
KEYWORD
sign,mult,easy
AUTHOR
Michael Somos, Feb 26 2011
STATUS
approved