OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3, -3, 2).
FORMULA
MATHEMATICA
LinearRecurrence[{3, -3, 2}, {0, 1, 5}, 40] (* Harvey P. Dale, Mar 05 2013 *)
RecurrenceTable[{a[0]==0, a[1]==1, a[n]==(2^n) + a[n-1] - a[n-2]}, a, {n, 50}] (* Vincenzo Librandi, Nov 15 2018 *)
PROG
(PARI) {m=32; v=concat([0, 1, 5], vector(m-3)); for(n=4, m, v[n]=3*v[n-1]-3*v[n-2]+2*v[n-3]); v} /* Klaus Brockhaus, Jun 21 2007 */
(Magma) m:=32; S:=[[0, 1, 3][(n-1) mod 3 +1]: n in [1..m]]; [&+[Binomial(i-1, k-1)*S[k]: k in [1..i]]: i in [1..m]]; /* Klaus Brockhaus, Jun 21 2007 */
(Magma) I:=[0, 1, 5]; [n le 3 select I[n] else 3*Self(n-1)-3*Self(n-2)+2*Self(n-3): n in [1..50]]; // Vincenzo Librandi, Nov 15 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Paul Curtz, Jun 18 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus, Jun 21 2007
STATUS
approved