%I #34 Sep 06 2024 14:49:03
%S 0,3,6,18,45,120,312,819,2142,5610,14685,38448,100656,263523,689910,
%T 1806210,4728717,12379944,32411112,84853395,222149070,581593818,
%U 1522632381,3986303328,10436277600,27322529475,71531310822,187271402994,490282898157,1283577291480
%N Expansion of 3*x/(1 - 2*x^2 - 2*x + x^3).
%H Colin Barker, <a href="/A120718/b120718.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,2,-1).
%F a(n) = 3*A001654(n). - _Arkadiusz Wesolowski_, Sep 15 2012
%F From _Colin Barker_, Oct 01 2016: (Start)
%F a(n) = 2*a(n-1) + 2*a(n-2) - a(n-3) for n>2.
%F a(n) = (3/2^(n+1))*( (1-sqrt(5))*(3-sqrt(5))^n + (1+sqrt(5))*(3+sqrt(5))^n + (-2)^(n+1) )/5. (End)
%F a(n) = (3/5)*(Lucas(2*n+1) - (-1)^n). - _G. C. Greubel_, Jul 21 2023
%t LinearRecurrence[{2,2,-1}, {0,3,6}, 60] (* _Vladimir Joseph Stephan Orlovsky_, Feb 13 2012 *)
%t CoefficientList[Series[3x/(1-2x^2-2x+x^3),{x,0,30}],x] (* _Harvey P. Dale_, Sep 06 2024 *)
%o (PARI) a(n) = 3*(fibonacci(2*n+2) + fibonacci(2*n) - (-1)^n)/5 \\ _Colin Barker_, Oct 01 2016
%o (PARI) concat(0, Vec(3*x/(1-2*x^2-2*x+x^3) + O(x^40))) \\ _Colin Barker_, Oct 01 2016
%o (Magma) [(3/5)*(Lucas(2*n+1) -(-1)^n): n in [0..40]]; // _G. C. Greubel_, Jul 21 2023
%o (SageMath) [(3/5)*(lucas_number2(2*n+1,1,-1) -(-1)^n) for n in range(41)] # _G. C. Greubel_, Jul 21 2023
%Y Cf. A000032, A000045, A001654, A001906, A072845.
%K nonn,easy
%O 0,2
%A _Roger L. Bagula_, Aug 13 2006
%E Offset corrected by _Arkadiusz Wesolowski_, Sep 15 2012