OFFSET
0,3
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 912
Index entries for linear recurrences with constant coefficients, signature (4,1,-3).
FORMULA
G.f.: (1-3*x)/(1 - 4*x - x^2 + 3*x^3).
a(n) = 4*a(n-1) + a(n-2) - 3*a(n-3), with a(0)=1, a(1)=1, a(2)=5.
a(n) = Sum_{r=RootOf(1-4*z-z^2+3*z^3)} (-1/761)*(17 -278*r +15*r^2)*r^(-1-n).
MAPLE
spec:= [S, {S=Sequence(Prod(Z, Union(Z, Sequence(Union(Z, Z, Z))) ))}, unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
seq(coeff(series((1-3*x)/(1-4*x-x^2+3*x^3), x, n+1), x, n), n = 0 .. 40); # G. C. Greubel, Oct 17 2019
MATHEMATICA
LinearRecurrence[{4, 1, -3}, {1, 1, 5}, 40] (* Vincenzo Librandi, Jun 22 2012 *)
PROG
(Magma) I:=[1, 1, 5]; [n le 3 select I[n] else 4*Self(n-1)+Self(n-2) -3*Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
(PARI) my(x='x+O('x^30)); Vec((1-3*x)/(1-4*x-x^2+3*x^3)) \\ G. C. Greubel, Oct 17 2019
(Sage)
def A052926_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P((1-3*x)/(1-4*x-x^2+3*x^3)).list()
A052926_list(30) # G. C. Greubel, Oct 17 2019
(GAP) a:=[1, 1, 5];; for n in [4..30] do a[n]:=4*a[n-1]+a[n-2]-3*a[n-3]; od; a; # G. C. Greubel, Oct 17 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
EXTENSIONS
More terms from James A. Sellers, Jun 08 2000
STATUS
approved