A087940 a(n) = Sum_{k=0..n} binomial(n+(-1)^k, k).
1, 5, 9, 20, 39, 80, 159, 320, 639, 1280, 2559, 5120, 10239, 20480, 40959, 81920, 163839, 327680, 655359, 1310720, 2621439, 5242880, 10485759, 20971520, 41943039, 83886080, 167772159, 335544320, 671088639, 1342177280, 2684354559, 5368709120, 10737418239
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
- Index entries for linear recurrences with constant coefficients, signature (2,1,-2).
Crossrefs
Cf. A321643 (first differences).
Programs
-
Mathematica
Join[{1},LinearRecurrence[{2,1,-2},{5,9,20},40]] (* Harvey P. Dale, Feb 03 2015 *)
-
PARI
a(n) = sum(k=0,n,binomial(n+(-1)^k,k)); \\ Michel Marcus, Dec 06 2013
Formula
For n>1 a(n) = 5*2^(n-2)-(1-(-1)^n)/2.
From Colin Barker, Jun 26 2013: (Start)
For n>4 a(n) = 2*a(n-1)+a(n-2)-2*a(n-3).
G.f.: -x*(x^3+2*x^2-3*x-1) / ((x-1)*(x+1)*(2*x-1)). (End)
Extensions
Two more terms from Michel Marcus, Dec 06 2013