%I #60 Oct 28 2022 14:23:16
%S 1,0,2,1,6,5,19,21,62,82,207,308,703,1131,2417,4096,8382,14705,29242,
%T 52497,102431,186733,359790,662630,1266103,2347680,4460939,8309143,
%U 15730497,29388368,55500634,103895601,195890270,367187437,691566411,1297452581
%N Expansion of (1 - x^2)/(1 - 3*x^2 - x^3).
%C Sequence is related to rhombus substitution tilings.
%H Robert Israel, <a href="/A188048/b188048.txt">Table of n, a(n) for n = 0..3286</a>
%H L. Edson Jeffery, <a href="/wiki/User:L._Edson_Jeffery/Unit-Primitive_Matrices">Unit-primitive matrix</a>
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (0,3,1).
%F G.f.: (1 - x^2)/(1 - 3*x^2 - x^3).
%F a(n) = 3*a(n-2)+a(n-3), for n>=3, with a(0)=1, a(1)=0, a(2)=2.
%F a(n) = a(n-1)+3*a(n-2)-2*a(n-3)-a(n-4), for n>=4, with {a(k)}={1,0,2,1}, k=0,1,2,3.
%F a(n) = A187497(3*n+1).
%F a(n) = m_(3,3), where (m_(i,j)) = (U_1)^n, i,j=1,2,3,4 and U_1 is the tridiagonal unit-primitive matrix [0, 1, 0, 0; 1, 0, 1, 0; 0, 1, 0, 1; 0, 0, 1, 1].
%F 3*(-1)^n*a(n) = A215664(n). - _Roman Witula_, Aug 20 2012
%F a(2n) = A094831(n); a(2n+1) = A094834(n). - _John Blythe Dobson_, Jun 20 2015
%F a(n) = A052931(n)-A052931(n-2). - _R. J. Mathar_, Nov 03 2020
%F a(n) = (2^n/3)*(cos^n(Pi/9) + cos^n(5*Pi/9) + cos^n(7*Pi/9)). - _Greg Dresden_, Sep 24 2022
%p F:= gfun:-rectoproc({a(n)=3*a(n-2)+a(n-3),a(0)=1,a(1)=0,a(2)=2},a(n),remember):
%p map(F, [$0..100]); # _Robert Israel_, Jun 21 2015
%t CoefficientList[Series[(1-x^2)/(1-3x^2-x^3),{x,0,40}],x] (* _Harvey P. Dale_, Mar 31 2011 *)
%t LinearRecurrence[{0,3,1}, {1,0,2}, 50] (* _Roman Witula_, Aug 20 2012 *)
%o (PARI) abs(polsym(1-3*x+x^3,66)/3) /* _Joerg Arndt_, Aug 19 2012 */
%o (Magma) I:=[1,0,2,1]; [n le 4 select I[n] else Self(n-1)+3*Self(n-2)-2*Self(n-3)-Self(n-4): n in [1..40]]; // _Vincenzo Librandi_, Jun 22 2015
%Y Cf. A052931.
%K nonn,easy
%O 0,3
%A _L. Edson Jeffery_, Mar 19 2011