OFFSET
0,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
G.f.: (1-x+x^2+x^3)/((1-x)^2*(1-2*x)) (Cf. A026622). - Ralf Stephan, Feb 05 2004
From G. C. Greubel, Jun 15 2024: (Start)
a(n) = 2*a(n-1) + 2*(n-1), with a(0) = 1, a(1) = 3.
a(n) = 7*2^(n-1) - 2*(n+1) - (1/2)*[n=0].
E.g.f.: (1/2)*( 7*exp(2*x) - 4*(x+1)*exp(x) - 1). (End)
MATHEMATICA
Table[(7*2^n -4*(n+1) -Boole[n==0])/2, {n, 0, 40}] (* G. C. Greubel, Jun 15 2024 *)
PROG
(Magma) [1] cat [n le 1 select 3 else 2*Self(n-1) + 2*(n-1): n in [1..41]]; // G. C. Greubel, Jun 15 2024
(SageMath) [(7*2^n -4*(n+1) -int(n==0))/2 for n in range(41)] # G. C. Greubel, Jun 15 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved