A135431 a(n) = a(n-1) + a(n-2) + a(n-3) - a(n-4) with a(0)=0, a(1)=1, a(2)=2 and a(3)=3.
0, 1, 2, 3, 6, 10, 17, 30, 51, 88, 152, 261, 450, 775, 1334, 2298, 3957, 6814, 11735, 20208, 34800, 59929, 103202, 177723, 306054, 527050, 907625, 1563006, 2691627, 4635208, 7982216, 13746045, 23671842, 40764895, 70200566, 120891258, 208184877, 358511806
Offset: 0
Keywords
Links
- G. C. Greubel, Table of n, a(n) for n = 0..1000
- Index entries for linear recurrences with constant coefficients, signature (1, 1, 1, -1).
Programs
-
Mathematica
LinearRecurrence[{1, 1, 1, -1}, {0, 1, 2, 3}, 40] (* Vladimir Joseph Stephan Orlovsky, Feb 03 2012 *) nxt[{a_,b_,c_,d_}]:={b,c,d,d+c+b-a}; NestList[nxt,{0,1,2,3},40][[All,1]] (* Harvey P. Dale, Feb 28 2021 *)
Formula
From R. J. Mathar, Mar 31 2008: (Start)
O.g.f.: x*(1+x)/(1-x-x^2-x^3+x^4).