login
a(n) = a(n-1) + Sum_{k=0..n-3} a(k) for n >= 2, a(0)=1, a(1)=2.
4

%I #30 May 12 2022 15:01:47

%S 1,2,2,3,6,11,19,33,58,102,179,314,551,967,1697,2978,5226,9171,16094,

%T 28243,49563,86977,152634,267854,470051,824882,1447567,2540303,

%U 4457921,7823106,13728594,24092003,42278518,74193627

%N a(n) = a(n-1) + Sum_{k=0..n-3} a(k) for n >= 2, a(0)=1, a(1)=2.

%H Reinhard Zumkeller, <a href="/A049853/b049853.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (2,-1,1).

%F a(n) = 2*a(n-1) - a(n-2) + a(n-3); 3 initial terms required.

%F a(n) = a(n-1) + a(n-2) + a(n-4) for n > 3. - _Reinhard Zumkeller_, Aug 06 2011

%F Empirical: a(n) = Sum_{k=0..floor(n/3)} A084534(n-2*k, n-3*k). - _Johannes W. Meijer_, Jun 17 2018

%F G.f.: (1 - x)*(1 + x) / (1 - 2*x + x^2 - x^3). - _Colin Barker_, Jun 17 2018

%p a := proc(n) option remember: if n<2 then n+1 else a(n-1) + add(a(k), k=0..n-3) fi end: seq(a(n), n=0..33); # _Johannes W. Meijer_, Jun 18 2018

%t LinearRecurrence[{2,-1,1},{1,2,2},40] (* _Harvey P. Dale_, May 12 2022 *)

%o (Haskell)

%o a049853 n = a049853_list !! n

%o a049853_list = 1 : 2 : 2 : 3 :

%o zipWith (+) a049853_list

%o (zipWith (+) (drop 2 a049853_list) (drop 3 a049853_list))

%o -- _Reinhard Zumkeller_, Aug 06 2011

%o (PARI) Vec((1 - x)*(1 + x) / (1 - 2*x + x^2 - x^3) + O(x^40)) \\ _Colin Barker_, Jun 17 2018

%Y Cf. A070550, A180662 (Ca2).

%K nonn,easy

%O 0,2

%A _Clark Kimberling_