OFFSET
0,1
LINKS
Index entries for linear recurrences with constant coefficients, signature (3, -3, 2).
FORMULA
G.f.: (3-6*x+4*x^2)/((1-2*x)*(1-x+x^2)).
a(n) = 3a(n-1) - 3a(n-2) + 2a(n-3). - Paul Curtz, Apr 24 2008
MATHEMATICA
Differences[LinearRecurrence[{3, -3, 2}, {0, 1, 5}, 40], 2] (* or *) LinearRecurrence[{3, -3, 2}, {3, 3, 4}, 40] (* Harvey P. Dale, Aug 05 2024 *)
PROG
(Magma) m:=34; S:=[ [0, 1, 3][ (n-1) mod 3 +1 ]: n in [1..m] ]; T:=[ &+[ Binomial(i-1, k-1)*S[k]: k in [1..i] ]: i in [1..m] ]; U:=[ T[n+1]-T[n]: n in[1..m-1] ]; [ U[n+1]-U[n]: n in[1..m-2] ]; /* Klaus Brockhaus, Jun 21 2007 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, Jun 18 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus, Jun 21 2007
STATUS
approved