OFFSET
1,2
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (9,0,1,-9).
FORMULA
a(n) = 9*a(n-1) + a(n-3) - 9*a(n-4).
G.f.: x*(x^2+1) / ((x-1)*(9*x-1)*(x^2+x+1)). - Colin Barker, Apr 30 2014
E.g.f.: exp(-x/2)*(123*exp(19*x/2) - 91*exp(3*x/2) - 32*cos(sqrt(3)*x/2) + 40*sqrt(3)*sin(sqrt(3)*x/2))/1092. - Stefano Spezia, Apr 25 2023
a(n) = floor((41/364)*9^n). - Kevin Ryde, Apr 26 2023
MATHEMATICA
Module[{nn=20, c}, c=PadRight[{}, nn, {1, 0, 1}]; Table[FromDigits[Take[c, n], 9], {n, nn}]] (* or *) LinearRecurrence[{9, 0, 1, -9}, {1, 9, 82, 739}, 20] (* Harvey P. Dale, Jan 03 2014 *)
PROG
(PARI) Vec(x*(x^2+1)/((x-1)*(9*x-1)*(x^2+x+1)) + O(x^100)) \\ Colin Barker, Apr 30 2014
(PARI) a(n) = 41*9^n \ 364; \\ Kevin Ryde, Apr 26 2023
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved