login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A052942 Expansion of 1/((1+x)*(1-2*x+2*x^2-2*x^3)). 10
1, 1, 1, 1, 3, 5, 7, 9, 15, 25, 39, 57, 87, 137, 215, 329, 503, 777, 1207, 1865, 2871, 4425, 6839, 10569, 16311, 25161, 38839, 59977, 92599, 142921, 220599, 340553, 525751, 811593, 1252791, 1933897, 2985399, 4608585, 7114167, 10981961 (list; graph; refs; listen; history; text; internal format)
OFFSET

0,5

COMMENTS

The compositions of n  in which each natural number is colored by one of  p different colors are called p-colored compositions of n.  For n >= 4, 3*a(n-4) equals the number of 3-colored compositions of n with all parts >= 4, such that  no adjacent parts have  the same color. - Milan Janjic, Nov 27 2011

a(n+3) equals the number of ternary words of length n having at least 3 zeros between every two successive nonzero letters. - Milan Janjic, Mar 09 2015

LINKS

G. C. Greubel, Table of n, a(n) for n = 0..1000

INRIA Algorithms Project, Encyclopedia of Combinatorial Structures 933

Index entries for linear recurrences with constant coefficients, signature (1,0,0,2).

FORMULA

G.f.: 1/(1-x-2*x^4).

a(n) = a(n-1) + 2*a(n-4), with a(1)=1, a(0)=1, a(2)=1, a(3)=1.

a(n) = Sum_{alpha=RootOf(-1+_Z+2*_Z^4)} (1/539)*(27 + 72*alpha^3 + 96*alpha^2 + 128*alpha)*alpha^(-1-n)).

a(n) = Sum_{k=0..floor(n/3)} A128099(n-2*k, k). - Johannes W. Meijer, Aug 28 2013

a(n) = hypergeom([(1-n)/4,(2-n)/4,(3-n)/4,-n/4],[(1-n)/3,(2-n)/3,-n/3],-512/27)) for n>=9. - Peter Luschny, Mar 09 2015

MAPLE

spec := [S, {S=Sequence(Union(Z, Prod(Union(Z, Z), Z, Z, Z)))}, unlabeled ]: seq(combstruct[count ](spec, size=n), n=0..20);

seq(add(binomial(n-3*k, k)*2^k, k=0..floor(n/3)), n=0..39); # Zerinvary Lajos, Apr 03 2007

with(combstruct): SeqSeqSeqL := [T, {T=Sequence(S), S=Sequence(U, card >= 1), U=Sequence(Z, card >3)}, unlabeled]: seq(count(SeqSeqSeqL, size=j+4), j=0..39); # Zerinvary Lajos, Apr 04 2009

a := n -> `if`(n<9, [1, 1, 1, 1, 3, 5, 7, 9, 15][n+1], hypergeom([(1-n)/4, (2-n)/4, (3-n)/4, -n/4], [(1-n)/3, (2-n)/3, -n/3], -512/27)):

seq(simplify(a(n)), n=0..39); # Peter Luschny, Mar 09 2015

MATHEMATICA

CoefficientList[Series[1/(1-x-2*x^4), {x, 0, 40}], x] (* Vincenzo Librandi, Mar 10 2015 *)

PROG

(PARI) Vec( 1/(1-x-2*x^4)  +O(x^66)) \\ Joerg Arndt, Aug 28 2013

(MAGMA) I:=[1, 1, 1, 1]; [n le 4 select I[n] else Self(n-1)+2*Self(n-4): n in [1..40]]; // Vincenzo Librandi, Mar 10 2015

(Sage) (1/(1-x-2*x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 12 2019

(GAP) a:=[1, 1, 1, 1];; for n in [5..40] do a[n]:=a[n-1]+2*a[n-4]; od; a; # G. C. Greubel, Jun 12 2019

CROSSREFS

Column k=3 of A143453.

Sequence in context: A100866 A327823 A102633 * A240944 A117913 A064411

Adjacent sequences:  A052939 A052940 A052941 * A052943 A052944 A052945

KEYWORD

easy,nonn

AUTHOR

encyclopedia(AT)pommard.inria.fr, Jan 25 2000

EXTENSIONS

More terms from James A. Sellers, Jun 06 2000

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 12 00:24 EDT 2021. Contains 342912 sequences. (Running on oeis4.)