OFFSET
1,1
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Index entries for linear recurrences with constant coefficients, signature (3,-2).
FORMULA
a(n) = -3+13*2^(n-1).
G.f.: x*(10-7*x)/(1-3*x+2*x^2). - Vincenzo Librandi, May 02 2012
a(n) = 3*a(n-1) - 2*a(n-2). - Vincenzo Librandi, May 02 2012
MATHEMATICA
LinearRecurrence[{3, -2}, {10, 23}, 30] (* Vincenzo Librandi, May 02 2012 *)
NestList[2#+3&, 10, 40] (* Harvey P. Dale, Jul 08 2019 *)
PROG
(Magma) I:=[10, 23]; [n le 2 select I[n] else 3*Self(n-1)-2*Self(n-2): n in [1..30]]; // Vincenzo Librandi, May 02 2012
(Python)
from itertools import accumulate
def f(an, _): return 2*an + 3
print(list(accumulate([10]*31, f))) # Michael S. Branicky, Oct 23 2021
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Vincenzo Librandi, Feb 08 2009
EXTENSIONS
Definition and closed form corrected by Paolo P. Lava, Feb 13 2009
STATUS
approved