login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A101945
a(n) = 6*2^n - n - 5.
6
1, 6, 17, 40, 87, 182, 373, 756, 1523, 3058, 6129, 12272, 24559, 49134, 98285, 196588, 393195, 786410, 1572841, 3145704, 6291431, 12582886, 25165797, 50331620, 100663267, 201326562, 402653153, 805306336, 1610612703, 3221225438
OFFSET
0,2
FORMULA
a(n) = 4*a(n-1) - 5*a(n-2) + 2*a(n-3) for n >= 3.
Row sums of triangle A135855. - Gary W. Adamson, Dec 01 2007
From G. C. Greubel, Feb 06 2022: (Start)
G.f.: (1 + 2*x - 2*x^2)/((1-x)^2*(1-2*x)).
E.g.f.: 6*exp(2*x) - (5+x)*exp(x). (End)
MATHEMATICA
a[0]=1; a[1]=6; a[2]=17; a[n_]:= a[n]= 4a[n-1] -5a[n-2] +2a[n-3];
Table[a[n], {n, 0, 30}] (* Robert G. Wilson v, Jan 12 2005 *)
PROG
(PARI) a(n)=if(n==1, 1, if(n==2, 6, if(n==3, 17, 4*a(n-1)-5*a(n-2)+2*a(n-3)))) \\ (Klasen)
(Magma) [6*2^n -n-5: n in [0..40]]; // G. C. Greubel, Feb 06 2022
(Sage) [3*2^(n+1) -(n+5) for n in (0..40)] # G. C. Greubel, Feb 06 2022
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Gary W. Adamson, Dec 22 2004
EXTENSIONS
More terms from Lambert Klasen (Lambert.Klasen(AT)gmx.net), Jan 06 2005
New definition from Ralf Stephan, May 17 2007
STATUS
approved