A101945 a(n) = 6*2^n - n - 5.
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
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (4,-5,2).
Programs
-
Magma
[6*2^n -n-5: n in [0..40]]; // G. C. Greubel, Feb 06 2022
-
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 *)
-
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)
-
Sage
[3*2^(n+1) -(n+5) for n in (0..40)] # G. C. Greubel, Feb 06 2022
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)
Extensions
More terms from Lambert Klasen (Lambert.Klasen(AT)gmx.net), Jan 06 2005
New definition from Ralf Stephan, May 17 2007