%I #20 May 10 2021 00:48:06
%S 0,1,2,5,7,9,25,34,43,120,163,206,575,781,987,2755,3742,4729,13200,
%T 17929,22658,63245,85903,108561,303025,411586,520147,1451880,1972027,
%U 2492174,6956375,9448549,11940723,33329995,45270718,57211441,159693600
%N a(n) = 5*a(n-3) - a(n-6) with terms 1..6 as 0, 1, 2, 5, 7, 9.
%H Colin Barker, <a href="/A142879/b142879.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Rec#order_06">Index entries for linear recurrences with constant coefficients</a>, signature (0,0,5,0,0,-1).
%F a(n) = 2*a(n - 1) + a(n - 2) if 3 | n, a(n) = a(n - 1) + a(n - 2) if n = 1 mod 3, and a(n) = 2*a(n - 1) - a(n - 2) if n = 2 mod 3.
%F G.f.: x^2*(1+2*x+5*x^2+2*x^3-x^4) / (1-5*x^3+x^6). - _Colin Barker_, Jan 08 2013
%t Clear[a, n]; a[0] = 0; a[1] = 1; a[n_] := a[n] = If[Mod[n, 3] == 0, 2*a[n - 1] + a[n - 2], If[Mod[n, 3] == 1, a[n - 1] + a[n - 2], 2*a[n - 1] - a[n - 2]]]; b = Table[a[n], {n, 0, 50}]
%t LinearRecurrence[{0,0,5,0,0,-1},{0,1,2,5,7,9},40] (* _Harvey P. Dale_, Apr 06 2016 *)
%o (PARI) a=vector(20); a[1]=1; a[2]=2; for(n=3, #a, if(n%3==0, a[n]=2*a[n-1]+a[n-2], if(n%3==1, a[n]=a[n-1]+a[n-2], a[n]=2*a[n-1]-a[n-2]))); concat(0, a) \\ _Colin Barker_, Jan 30 2016
%o (PARI) concat(0, Vec(x^2*(1+2*x+5*x^2+2*x^3-x^4)/(1-5*x^3+x^6) + O(x^50))) \\ _Colin Barker_, Jan 30 2016
%Y Cf. A119016, A002965, A002530, A048788.
%K nonn,easy
%O 1,3
%A _Roger L. Bagula_ and _Gary W. Adamson_, Sep 28 2008
%E New name from _Colin Barker_ and _Charles R Greathouse IV_, Jan 08 2013