A084172 a(n) = 3*a(n-1) - a(n-2) - 3*a(n-3) + 2*a(n-4).
1, 2, 4, 9, 19, 40, 82, 167, 337, 678, 1360, 2725, 5455, 10916, 21838, 43683, 87373, 174754, 349516, 699041, 1398091, 2796192, 5592394, 11184799, 22369609, 44739230, 89478472, 178956957, 357913927, 715827868, 1431655750, 2863311515
Offset: 0
Links
- Vincenzo Librandi, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (3,-1,-3,2).
Programs
-
Magma
[2^(n+2)/3-(-1)^n/12-(2*n+1)/4: n in [0..35]]; // Vincenzo Librandi, Jul 05 2011
-
Mathematica
LinearRecurrence[{3,-1,-3,2},{1,2,4,9},40] (* Harvey P. Dale, Nov 13 2013 *)
Formula
a(n) = 2^(n+2)/3 - (-1)^n/12 - (2*n+1)/4.
G.f: (2*x^3 - x^2 - x + 1)/( (x+1)*(1-2*x)*(1-x)^2).
a(n+2) = a(n+1) + 2*a(n) + n, a(0)=0, a(1)=2.
a(n+1) = 2*a(n) + floor(n/2). Franklin T. Adams-Watters, Oct 17 2013
a(n)+a(n+1) = A095768(n+1). - R. J. Mathar, Apr 15 2024
Comments