%I #33 Feb 26 2020 15:14:22
%S 0,1,2,4,9,19,41,88,189,406,872,1873,4023,8641,18560,39865,85626,
%T 183916,395033,848491,1822473,3914488,8407925,18059374,38789712,
%U 83316385,178955183,384377665,825604416,1773314929,3808901426
%N a(0) = 0, a(1) = 1, a(2) = 2; for n > 2, a(n) = a(n-1) + 2*a(n-2) + a(n-3).
%C Central axis of triangle G(n, k): G(n,0) = G(n+1, n+1) = 1, G(n+2, n+1) = 2, G(n+3, n+1) = 4, G(n+4, k) = G(n+1, k-1) + G(n+1, k) + G(n+2, k) + G(n+3, k) for k = 1..(n+1). (This is triangular array A140997.)
%C Central axis of triangle G(n, k): G(n, n) = G(n+1, 0) = 1, G(n+2, 1) = 2, G(n+3, 2) = 4, G(n+4, k) = G(n+1, k-2) + G(n+1, k-3) + G(n+2, k-2) + G(n+3, k-1) for k = 3..(n+3). (This is triangular array A140994, which is a mirror image of A140997.)
%C a(n-1) is the top left entry of the n-th power of any of the 3X3 matrices [0, 1, 1; 1, 1, 1; 0, 1, 0], [0, 1, 0; 1, 1, 1; 1, 1, 0], [0, 1, 1; 0, 0, 1; 1, 1, 1] or [0, 0, 1; 1, 0, 1; 1, 1, 1]. - _R. J. Mathar_, Feb 03 2014
%H G. C. Greubel, <a href="/A141015/b141015.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 (1,2,1).
%F From _R. J. Mathar_, Aug 22 2008: (Start)
%F O.g.f.: x*(1 + x)/(1 - x - 2*x^2 - x^3).
%F a(n) = (-1)^(n+1)*A078039(n-1). (End)
%t CoefficientList[Series[x (1 + x)/(1 - x - 2 x^2 - x^3), {x,0,50}], x] (* _G. C. Greubel_, Jun 09 2017 *)
%o (Sage) from sage.combinat.sloane_functions import recur_gen3; it = recur_gen3(0,1,2,1,2,1); [next(it) for i in range(31)] # _Zerinvary Lajos_, May 17 2009
%o (PARI) x='x+O('x^50); concat([0], Vec(x*(1+x)/(1-x-2*x^2-x^3))) \\ _G. C. Greubel_, Jun 09 2017
%Y Cf. A000129, A140994, A140997.
%K nonn,easy
%O 0,3
%A _Juri-Stepan Gerasimov_, Jul 11 2008
%E Typo in definition corrected by _Paolo P. Lava_, Jul 31 2008
%E Dysfunctional Maple program removed by _R. J. Mathar_, Oct 28 2009
%E Comments clarified by _Petros Hadjicostas_, Jun 12 2019