A081660 n+A001045(n+1).
1, 2, 5, 8, 15, 26, 49, 92, 179, 350, 693, 1376, 2743, 5474, 10937, 21860, 43707, 87398, 174781, 349544, 699071, 1398122, 2796225, 5592428, 11184835, 22369646, 44739269, 89478512, 178956999, 357913970, 715827913, 1431655796, 2863311563
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+1)/3+n+(-1)^n/3: n in [0..40]]; // Vincenzo Librandi, Aug 10 2013
-
Mathematica
Table[2^(n + 1)/3 + n + (-1)^n/3, {n, 0, 40}] (* Vincenzo Librandi, Aug 10 2013 *) LinearRecurrence[{3,-1,-3,2},{1,2,5,8},40] (* Harvey P. Dale, Feb 23 2025 *)
Formula
a(n) = 2^(n+1)/3+n+(-1)^n/3.
G.f.: (1-x-2*x^3)/((1+x)*(1-2*x)*(1-x)^2). [Bruno Berselli, Aug 11 2013]