OFFSET
0,2
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (3,-1,-1).
FORMULA
a(n)=2*a(n-1)+a(n-2)+8; a(0)=1, a(1)=10.
a(n)=[ {(9+5*sqrt(2))(1+sqrt(2))^n - (9-5*sqrt(2))(1-sqrt(2))^n}/2*sqrt(2) ]-4.
a(0)=1, a(1)=10, a(2)=29, a(n)=3*a(n-1)-a(n-2)-a(n-3). - Harvey P. Dale, Apr 20 2012
MATHEMATICA
Accumulate[LinearRecurrence[{2, 1}, {1, 9}, 30]] (* or *) LinearRecurrence[ {3, -1, -1}, {1, 10, 29}, 30] (* Harvey P. Dale, Apr 20 2012 *)
PROG
(Haskell)
a048772 n = a048772_list !! n
a048772_list = scanl1 (+) a048696_list
-- Reinhard Zumkeller, Dec 15 2013
(PARI) a(n)=([0, 1, 0; 0, 0, 1; -1, -1, 3]^n*[1; 10; 29])[1, 1] \\ Charles R Greathouse IV, Feb 10 2017
CROSSREFS
KEYWORD
easy,nice,nonn
AUTHOR
STATUS
approved