OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (8,-8,8,-7).
FORMULA
a(n) = 8*a(n-1) - 8*a(n-2) + 8*a(n-3) - 7*a(n-4).
From Colin Barker, Dec 24 2015: (Start)
a(n) = 1/100*((2-11*i)*(-i)^n+(2+11*i)*i^n+3*7^(n+1)-25) where i=sqrt(-1).
G.f.: x*(1+2*x) / ((1-x)*(1-7*x)*(1+x^2)).
(End)
MATHEMATICA
Module[{nn=20, c}, c=PadRight[{}, nn, {1, 3, 2, 0}]; Table[FromDigits[ Take[ c, n], 7], {n, nn}]] (* or *) LinearRecurrence[{8, -8, 8, -7}, {1, 10, 72, 504}, 20] (* Harvey P. Dale, Jan 24 2014 *)
PROG
(PARI) Vec(x*(1+2*x)/((1-x)*(1-7*x)*(1+x^2)) + O(x^30)) \\ Colin Barker, Dec 24 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved