OFFSET
0,2
COMMENTS
A transform of A000302 under the mapping mapping g(x) -> (1/(1-x^3)) * g(x/(1-x^3)). - Paul Barry, Oct 20 2004
a(n) equals the number of n-length words on {0,1,2,3,4} such that 0 appears only in a run which length is a multiple of 3. - Milan Janjic, Feb 17 2015
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 913
Milan Janjic, Binomial Coefficients and Enumeration of Restricted Words, Journal of Integer Sequences, 2016, Vol 19, #16.7.3.
Index entries for linear recurrences with constant coefficients, signature (4,0,1).
FORMULA
G.f.: 1/(1-4*x-x^3).
a(n) = 4*a(n-1) + a(n-3), with a(0)=1, a(1)=4, a(2)=16.
a(n) = Sum_{r=RootOf(-1+4*z+z^3)} (1/283)*(64 + 9*r + 24*r^2)*r^(-1-n).
a(n) = Sum_{k=0..floor(n/3)} binomial(n-2*k, k)*4^(n-3*k). - Paul Barry, Oct 20 2004
MAPLE
spec:= [S, {S=Sequence(Union(Z, Z, Z, Z, Prod(Z, Z, Z)))}, unlabeled]: seq(combstruct[count](spec, size=n), n=0..20);
seq(coeff(series(1/(1-4*x-x^3), x, n+1), x, n), n = 0..40); # G. C. Greubel, Oct 17 2019
MATHEMATICA
CoefficientList[Series[1/(1-4x-x^3), {x, 0, 40}], x] (* or *) LinearRecurrence[{4, 0, 1}, {1, 4, 16}, 40] (* Vladimir Joseph Stephan Orlovsky, Jan 28 2012 *)
PROG
(Magma) I:=[1, 4, 16]; [n le 3 select I[n] else 4*Self(n-1)+Self(n-3): n in [1..30]]; // Vincenzo Librandi, Jun 22 2012
(Magma) R<x>:=PowerSeriesRing(Integers(), 25); Coefficients(R!( 1/(1-4*x-x^3))); // Marius A. Burtea, Oct 18 2019
(PARI) my(x='x+O('x^30)); Vec(1/(1-4*x-x^3)) \\ G. C. Greubel, Oct 17 2019
(Sage)
def A052927_list(prec):
P.<x> = PowerSeriesRing(ZZ, prec)
return P( 1/(1-4*x-x^3) ).list()
A052927_list(30) # G. C. Greubel, Oct 17 2019
(GAP) a:=[1, 4, 16];; for n in [4..30] do a[n]:=4*a[n-1]+a[n-3]; od; a; # G. C. Greubel, Oct 17 2019
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
encyclopedia(AT)pommard.inria.fr, Jan 25 2000
STATUS
approved