OFFSET
1,3
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (-1,1,1).
FORMULA
a(n) = (-1)^(n+1)*A109613(n+1). - Michel Marcus, Dec 05 2017
From Colin Barker, Mar 14 2020: (Start)
G.f.: x*(1 + x^2) / ((1 - x)*(1 + x)^2).
a(n) = -a(n-1) + a(n-2) + a(n-3) for n>3.
(End)
MATHEMATICA
Array[(2 Floor[(# + 1)/2] - 1) (2 Boole@ OddQ@ # - 1) &, 52] (* or *)
Nest[Append[#, Block[{k = 1, s = 1}, While[Nand[FreeQ[#, s k], IntegerQ@ Mean[Append[#, s k]]], If[s == 1, s = -1, k++; s = 1]]; s k]] &, {1}, 51] (* Michael De Vlieger, Dec 12 2017 *)
PROG
(PARI) Vec(x*(1 + x^2) / ((1 - x)*(1 + x)^2) + O(x^50)) \\ Colin Barker, Mar 14 2020
CROSSREFS
KEYWORD
sign
AUTHOR
Enrique Navarrete, Dec 04 2017
STATUS
approved