OFFSET
0,2
COMMENTS
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-3,2).
FORMULA
a(n+1) - 2a(n) = A130772(n).
a(n) = 3*a(n-1) - 3*a(n-2) + 2*a(n-3) for n > 2; a(0) = 1, a(1) = 4, a(2) = 10.
G.f.: (1 + x + x^2)/(1 -3*x +3*x^2 -2*x^3). - Philippe Deléham, Dec 03 2009
MATHEMATICA
LinearRecurrence[{3, -3, 2}, {1, 4, 10}, 25] (* G. C. Greubel, Jul 29 2016 *)
RecurrenceTable[{a[0] == 1, a[1] == 4, a[2] == 10, a[n] == 3 a[n-1] - 3 a[n-2] + 2 a[n-3]}, a, {n, 40}] (* Vincenzo Librandi, Jul 30 2016 *)
PROG
(Magma) I:=[1, 4, 10]; [n le 3 select I[n] else 3*Self(n-1)- 3*Self(n-2)+2*Self(n-3): n in [1..40]]; // Vincenzo Librandi, Jul 30 2016
(PARI) a(n)=([0, 1, 0; 0, 0, 1; 2, -3, 3]^n*[1; 4; 10])[1, 1] \\ Charles R Greathouse IV, Jul 30 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Paul Curtz, Dec 02 2009
EXTENSIONS
Edited and extended by Klaus Brockhaus, Dec 03 2009
STATUS
approved