%I #24 Sep 08 2022 08:45:44
%S 1,4,22,110,562,2854,14514,73782,375106,1906982,9694866,49287446,
%T 250571106,1273871494,6476200114,32924174710,167382301826,
%U 850950257638,4326122494162,21993454571478,111811915784610,568437508112710
%N Expansion of (1-x)/(1-5*x-2*x^2+8*x^3).
%C Number of tilings of a 2 X n board with squares of 1 color and dominoes of 2 colors if n > 2. The number of tilings is 3 if n=1, and 17 if n=2.
%C a(n) = element(1,2) in A^n, where A is the 7 X 7 matrix defined by A(1,i) = A(7,i) = A(i,1) = A(i,7) = A(i,i) = A(i,7-i+1) = 1, and A(i,j) = 0 otherwise. - _Lechoslaw Ratajczak_, Jan 02 2017
%H Vincenzo Librandi, <a href="/A159616/b159616.txt">Table of n, a(n) for n = 0..1000</a>
%H M. Katz, C. Stenson, <a href="http://www.cs.uwaterloo.ca/journals/JIS/VOL12/Stenson/stenson8.html">Tiling a 2xn-board with squares and dominoes</a>, J. Int. Seq. 12 (2009) # 09.2.2.
%H <a href="/index/Rec#order_03">Index entries for linear recurrences with constant coefficients</a>, signature (5,2,-8).
%F G.f.: (1-x)/(1-5*x-2*x^2+8*x^3).
%F a(n) = 5*a(n-1) + 2*a(n-2) - 8*a(n-3) for n > 2 with a(0)=1, a(1)=4, a(2)=22. - _Harvey P. Dale_, Dec 22 2013
%p seq(coeff(series((1-x)/(1-5*x-2*x^2+8*x^3), x, n+1), x, n), n=0..40); # _G. C. Greubel_, Oct 27 2019~
%t CoefficientList[Series[(1-x)/(1-5*x-2*x^2+8*x^3), {x, 0, 40}], x] (* _Vincenzo Librandi_, Dec 11 2012 *)
%t LinearRecurrence[{5,2,-8}, {1,4,22}, 30] (* _Harvey P. Dale_, Dec 22 2013 *)
%o (PARI) my(x='x+O('x^40)); Vec((1-x)/(1-5*x-2*x^2+8*x^3)) \\ _G. C. Greubel_, Oct 27 2019
%o (Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x)/(1-5*x-2*x^2+8*x^3) )); // _G. C. Greubel_, Oct 27 2019
%o (Sage)
%o def A159616_list(prec):
%o P.<x> = PowerSeriesRing(ZZ, prec)
%o return P((1-x)/(1-5*x-2*x^2+8*x^3)).list()
%o A159616_list(40) # _G. C. Greubel_, Oct 27 2019
%o (GAP) a:=[1,4,22];; for n in [4..40] do a[n]:=5*a[n-1]+2*a[n-2]-8*a[n-3]; od; a; # _G. C. Greubel_, Oct 27 2019
%Y Cf. A030186, A102436, A159617.
%K easy,nonn
%O 0,2
%A _R. J. Mathar_, Apr 17 2009