OFFSET
1,2
LINKS
Colin Barker, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,0,1,-3).
FORMULA
a(n) = 3*a(n-1) + a(n-3) - 3*a(n-4).
G.f.: x*(1+x) / ((1-x)*(1-3*x)*(1+x+x^2)). - Colin Barker, Dec 24 2015
MATHEMATICA
Module[{nn=30, c}, c=PadRight[{}, nn, {1, 1, 0}]; Table[FromDigits[Take[c, n], 3], {n, nn}]] (* or *) LinearRecurrence[{3, 0, 1, -3}, {1, 4, 12, 37}, 30] (* Harvey P. Dale, Sep 01 2015 *)
PROG
(PARI) Vec(x*(1+x)/((1-x)*(1-3*x)*(1+x+x^2)) + O(x^30)) \\ Colin Barker, Dec 24 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
STATUS
approved