OFFSET
0,1
REFERENCES
B. Satyanarayana and K. S. Prasad, Discrete Mathematics and Graph Theory, PHI Learning Pvt. Ltd. (Eastern Economy Edition), 2009, p. 73 (problem 3.3).
LINKS
Bruno Berselli, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (1,2).
FORMULA
G.f.: (2+5*x)/((1+x)*(1-2*x)).
a(n) = 3*2^n - (-1)^n.
a(n) = 7 + 2*Sum_{i=0..n-2} a(i), for n>0.
a(n+2) - a(n) = a(n+1) + a(n) = A005010(n).
E.g.f.: 3*exp(2*x) - exp(-x). - G. C. Greubel, Feb 07 2025
MATHEMATICA
LinearRecurrence[{1, 2}, {2, 7}, 33]
PROG
(PARI) v=vector(33); v[1]=2; v[2]=7; for(i=3, #v, v[i]=v[i-1]+2*v[i-2]); v
(Magma) [n le 2 select 5*n-3 else Self(n-1)+2*Self(n-2): n in [1..33]];
(Maxima) a[0]:2$ a[1]:7$ a[n]:=a[n-1]+2*a[n-2]$ makelist(a[n], n, 0, 32);
(SageMath)
def A201630(n): return 3*2**n - (-1)**n
print([A201630(n) for n in range(31)]) # G. C. Greubel, Feb 07 2025
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Bruno Berselli, Dec 03 2011
STATUS
approved