login
A052958
Expansion of g.f.: (1-x)/(1-3*x-2*x^3+2*x^4).
1
1, 2, 6, 20, 62, 194, 610, 1914, 6006, 18850, 59158, 185658, 582662, 1828602, 5738806, 18010426, 56523158, 177389882, 556712886, 1747164122, 5483225814, 17208323450, 54005872822, 169489741850, 531919420822, 1669353361210
OFFSET
0,2
FORMULA
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.
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).
MAPLE
spec:= [S, {S=Sequence(Prod(Union(Prod(Z, Z), Sequence(Z)), Union(Z, Z)))}, unlabeled ]: seq(combstruct[count ](spec, size=n), n=0..20);
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
MATHEMATICA
LinearRecurrence[{3, 0, 2, -2}, {1, 2, 6, 20}, 40] (* G. C. Greubel, Oct 22 2019 *)
PROG
(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
(Magma) R<x>:=PowerSeriesRing(Integers(), 40); Coefficients(R!( (1-x)/(1-3*x-2*x^3+2*x^4) )); // G. C. Greubel, Oct 22 2019
(Sage)
def A052958_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1-x)/(1-3*x-2*x^3+2*x^4)).list()
A052958_list(40) # G. C. Greubel, Oct 22 2019
(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
CROSSREFS
Sequence in context: A132353 A263900 A260696 * A247076 A177792 A193235
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
STATUS
approved