# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a052958 Showing 1-1 of 1 %I A052958 #24 Sep 08 2022 08:44:59 %S A052958 1,2,6,20,62,194,610,1914,6006,18850,59158,185658,582662,1828602, %T A052958 5738806,18010426,56523158,177389882,556712886,1747164122,5483225814, %U A052958 17208323450,54005872822,169489741850,531919420822,1669353361210 %N A052958 Expansion of g.f.: (1-x)/(1-3*x-2*x^3+2*x^4). %H A052958 G. C. Greubel, Table of n, a(n) for n = 0..1000 %H A052958 INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 1029 %H A052958 Index entries for linear recurrences with constant coefficients, signature (3,0,2,-2). %F A052958 a(n) = 3*a(n-1) + 2*a(n-3) - 2*a(n-4), with a(0)=1, a(1)=2, a(2)=6, a(3)=20. %F A052958 a(n) = Sum_{alpha=RootOf(1-3*z-2*z^3+2*z^4)} (1/3259)*(491 + 503*alpha + 272*alpha^2 - 498*alpha^3)*alpha^(-1-n). %p A052958 spec:= [S,{S=Sequence(Prod(Union(Prod(Z,Z),Sequence(Z)),Union(Z,Z)))}, unlabeled ]: seq(combstruct[count ](spec,size=n), n=0..20); %p A052958 seq(coeff(series((1-x)/(1-3*x-2*x^3+2*x^4), x, n+1), x, n), n = 0..40); # _G. C. Greubel_, Oct 22 2019 %t A052958 LinearRecurrence[{3,0,2,-2}, {1,2,6,20}, 40] (* _G. C. Greubel_, Oct 22 2019 *) %o A052958 (PARI) my(x='x+O('x^40)); Vec((1-x)/(1-3*x-2*x^3+2*x^4)) \\ _G. C. Greubel_, Oct 22 2019 %o A052958 (Magma) R:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x)/(1-3*x-2*x^3+2*x^4) )); // _G. C. Greubel_, Oct 22 2019 %o A052958 (Sage) %o A052958 def A052958_list(prec): %o A052958 P. = PowerSeriesRing(ZZ, prec) %o A052958 return P((1-x)/(1-3*x-2*x^3+2*x^4)).list() %o A052958 A052958_list(40) # _G. C. Greubel_, Oct 22 2019 %o A052958 (GAP) a:=[1,2,6,20];; for n in [5..40] do a[n]:=3*a[n-1]+2*a[n-3] -2*a[n-4]; od; a; # _G. C. Greubel_, Oct 22 2019 %K A052958 easy,nonn %O A052958 0,2 %A A052958 encyclopedia(AT)pommard.inria.fr, Jan 25 2000 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE