OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
D. Birmajer, J. B. Gil, and M. D. Weiner, On the Enumeration of Restricted Words over a Finite Alphabet, J. Int. Seq. 19 (2016) # 16.1.3, example 11.
Index entries for linear recurrences with constant coefficients, signature (5,-4,4).
FORMULA
a(n+3) = 5*a(n+2) - 4*a(n+1)+ 4*a(n) with n>=0, a(0) = 1, a(1) = 4, a(2) = 17.
G.f.: (-1 + x - x^2)/(-1 + 5*x - 4*x^2 + 4*x^3). - R. J. Mathar, Nov 07 2015
MATHEMATICA
RecurrenceTable[{a[0] == 1, a[1] == 4, a[2]== 17, a[n] == 5 a[n - 1] - 4 a[n - 2] + 4 a[n - 3]}, a[n], {n, 0, 23}]
LinearRecurrence[{5, -4, 4}, {1, 4, 17}, 100] (* G. C. Greubel, Jun 02 2016 *)
CoefficientList[Series[(-1 + x - x^2) / (-1 + 5 x -4 x^2 + 4 x^3), {x, 0, 33}], x] (* Vincenzo Librandi, Feb 26 2018 *)
PROG
(Magma) I:=[1, 4, 17]; [n le 3 select I[n] else 5*Self(n-1)-4*Self(n-2)+4*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Feb 26 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Milan Janjic, Mar 07 2015
STATUS
approved