OFFSET
1,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Index entries for linear recurrences with constant coefficients, signature (2,-1,0,0,0,0,0,0,-1,2,-1).
FORMULA
a(n) = n + 9*(-1)^floor((n-1)/9).
From Colin Barker, Sep 24 2019: (Start)
G.f.: x*(10 - 9*x - 8*x^9 + 9*x^10) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 - x^3 + x^6)).
a(n) = 2*a(n-1) - a(n-2) - a(n-9) + 2*a(n-10) - a(n-11) for n>11.
(End)
MATHEMATICA
LinearRecurrence[{2, -1, 0, 0, 0, 0, 0, 0, -1, 2, -1}, {10, 11, 12, 13, 14, 15, 16, 17, 18, 1, 2}, 72] (* Metin Sariyar, Sep 24 2019 *)
Rest[CoefficientList[Series[x (10-9x-8x^9+9x^10)/((1-x)^2(1+x)(1-x+x^2)(1-x^3+x^6)), {x, 0, 80}], x]] (* Harvey P. Dale, Jul 20 2021 *)
PROG
(Haskell)
a100830 n = n + 9 * (-1) ^ ((n - 1) `div` 9)
-- Reinhard Zumkeller, Aug 01 2014
(PARI) Vec(x*(10 - 9*x - 8*x^9 + 9*x^10) / ((1 - x)^2*(1 + x)*(1 - x + x^2)*(1 - x^3 + x^6)) + O(x^80)) \\ Colin Barker, Sep 24 2019
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Reinhard Zumkeller, Jan 07 2005
STATUS
approved