cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-7 of 7 results.

A052942 Expansion of 1/((1+x)*(1-2*x+2*x^2-2*x^3)).

Original entry on oeis.org

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
Offset: 0

Views

Author

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

Keywords

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

Crossrefs

Column k=3 of A143453.

Programs

  • 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
  • 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
    
  • 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 *)
    LinearRecurrence[{1,0,0,2},{1,1,1,1},50] (* Harvey P. Dale, Aug 17 2024 *)
  • PARI
    Vec( 1/(1-x-2*x^4) + O(x^66)) \\ Joerg Arndt, Aug 28 2013
    
  • Sage
    (1/(1-x-2*x^4)).series(x, 40).coefficients(x, sparse=False) # G. C. Greubel, Jun 12 2019
    

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

Extensions

More terms from James Sellers, Jun 06 2000

A143447 Expansion of 1/(x^k*(1-x-2*x^(k+1))) for k=4.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 17, 27, 41, 59, 81, 115, 169, 251, 369, 531, 761, 1099, 1601, 2339, 3401, 4923, 7121, 10323, 15001, 21803, 31649, 45891, 66537, 96539, 140145, 203443, 295225, 428299, 621377, 901667, 1308553, 1899003, 2755601, 3998355, 5801689, 8418795
Offset: 0

Views

Author

Alois P. Heinz, Aug 16 2008

Keywords

Comments

a(n) is also the number of length n ternary words with at least 4 0-digits between any other digits.
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>=9, 3*a(n-9) equals the number of 3-colored compositions of n with all parts >=5, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011

Crossrefs

4th column of A143453.

Programs

  • Maple
    a:= proc(k::nonnegint) local n,i,j; if k=0 then unapply(3^n,n) else unapply((Matrix(k+1, (i,j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 2 else 0 fi)^(n+k))[1,1], n) fi end(4): seq(a(n), n=0..54);
  • Mathematica
    Series[1/(1-x-2*x^5), {x, 0, 54}] // CoefficientList[#, x]& // Drop[#, 4]& (* Jean-François Alcover, Feb 13 2014 *)

Formula

G.f.: ( -1-2*x-2*x^2-2*x^3-2*x^4 ) / ( -1+x+2*x^5 ). - R. J. Mathar, Aug 04 2019
G.f.: Q(0)/(2*x^4) -1/x -1/x^2 -1/x^3 -1/x^4, where Q(k) = 1 + 1/(1 - x*(2*k+1 + 2*x^4)/( x*(2*k+2 + 2*x^4) + 1/Q(k+1) )); (continued fraction). - Sergei N. Gladkovskii, Aug 29 2013
a(n) = 2n+1 if n<=5, else a(n) = a(n-1) + 2a(n-5). - Milan Janjic, Mar 09 2015

A143448 Expansion of 1/(x^k*(1-x-2*x^(k+1))) for k=5.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 19, 29, 43, 61, 83, 109, 147, 205, 291, 413, 579, 797, 1091, 1501, 2083, 2909, 4067, 5661, 7843, 10845, 15011, 20829, 28963, 40285, 55971, 77661, 107683, 149341, 207267, 287837, 399779, 555101, 770467, 1069149, 1483683, 2059357, 2858915
Offset: 0

Views

Author

Alois P. Heinz, Aug 16 2008

Keywords

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>=11, 3*a(n-11) equals the number of 3-colored compositions of n with all parts >=6, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011
a(n) equals the number of ternary words of length n having at least 5 zeros between every two successive nonzero letters. - Milan Janjic, Mar 09 2015

Crossrefs

5th column of A143453.

Programs

  • Maple
    a:= proc(k::nonnegint) local n,i,j; if k=0 then unapply(3^n,n) else unapply((Matrix(k+1, (i,j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 2 else 0 fi)^(n+k))[1,1], n) fi end(5): seq(a(n), n=0..56);
  • Mathematica
    Series[1/(1-x-2*x^6), {x, 0, 56}] // CoefficientList[#, x]& // Drop[#, 5]& (* Jean-François Alcover, Feb 13 2014 *)
    LinearRecurrence[{1,0,0,0,0,2},{1,3,5,7,9,11},50] (* Harvey P. Dale, Aug 15 2021 *)

Formula

G.f.: (-1 - 2 x - 2 x^2 - 2 x^3 - 2 x^4 - 2 x^5)/(-1 + x + 2 x^6) - Harvey P. Dale, Aug 15 2021
a(n) = 2n+1 if n<=6, else a(n) = a(n-1) + 2a(n-6). - Milan Janjic, Mar 09 2015

Extensions

Generating function corrected by Harvey P. Dale, Aug 15 2021

A143449 Expansion of 1/(x^k*(1-x-2*x^(k+1))) for k=6.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 21, 31, 45, 63, 85, 111, 141, 183, 245, 335, 461, 631, 853, 1135, 1501, 1991, 2661, 3583, 4845, 6551, 8821, 11823, 15805, 21127, 28293, 37983, 51085, 68727, 92373, 123983, 166237, 222823, 298789, 400959, 538413, 723159, 971125
Offset: 0

Views

Author

Alois P. Heinz, Aug 16 2008

Keywords

Comments

a(n) is also the number of length n ternary words with at least 6 0-digits between any other digits.
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>=13, 3*a(n-13) equals the number of 3-colored compositions of n with all parts >=7, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011

Crossrefs

6th column of A143453.

Programs

  • Maple
    a:= proc(k::nonnegint) local n,i,j; if k=0 then unapply(3^n,n) else unapply((Matrix(k+1, (i,j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 2 else 0 fi)^(n+k))[1,1], n) fi end(6): seq(a(n), n=0..58);
  • Mathematica
    Series[1/(1-x-2*x^7), {x, 0, 58}] // CoefficientList[#, x]& // Drop[#, 6]& (* Jean-François Alcover, Feb 13 2014 *)

Formula

G.f.: 1/(x^6*(1-x-2*x^7)).
a(n) = 2n+1 if n<=7, else a(n) = a(n-1) + 2a(n-7). - Milan Janjic, Mar 09 2015

A143450 Expansion of 1/(x^k*(1-x-2*x^(k+1))) for k=7.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 23, 33, 47, 65, 87, 113, 143, 177, 223, 289, 383, 513, 687, 913, 1199, 1553, 1999, 2577, 3343, 4369, 5743, 7569, 9967, 13073, 17071, 22225, 28911, 37649, 49135, 64273, 84207, 110353, 144495, 188945, 246767, 322065, 420335, 548881
Offset: 0

Views

Author

Alois P. Heinz, Aug 16 2008

Keywords

Comments

a(n) is also the number of length n ternary words with at least 7 0-digits between any other digits.
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>=15, 3*a(n-15) equals the number of 3-colored compositions of n with all parts >=8, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011

Crossrefs

7th column of A143453.

Programs

  • Maple
    a:= proc(k::nonnegint) local n,i,j; if k=0 then unapply(3^n,n) else unapply((Matrix(k+1, (i,j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 2 else 0 fi)^(n+k))[1,1], n) fi end(7): seq(a(n), n=0..61);
  • Mathematica
    Series[1/(1-x-2*x^8), {x, 0, 61}] // CoefficientList[#, x]& // Drop[#, 7]& (* Jean-François Alcover, Feb 13 2014 *)

Formula

G.f.: 1/(x^7*(1-x-2*x^8)).
a(n) = 2n+1 if n<=8, else a(n) = a(n-1) + 2a(n-8). - Milan Janjic, Mar 09 2015

A143451 Expansion of 1/(x^k*(1-x-2*x^(k+1))) for k=8.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 25, 35, 49, 67, 89, 115, 145, 179, 217, 267, 337, 435, 569, 747, 977, 1267, 1625, 2059, 2593, 3267, 4137, 5275, 6769, 8723, 11257, 14507, 18625, 23811, 30345, 38619, 49169, 62707, 80153, 102667, 131681, 168931, 216553, 277243
Offset: 0

Views

Author

Alois P. Heinz, Aug 16 2008

Keywords

Comments

a(n) is also the number of length n ternary words with at least 8 0-digits between any other digits.
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>=17, 3*a(n-17) equals the number of 3-colored compositions of n with all parts >=9, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011

Crossrefs

8th column of A143453.

Programs

  • Maple
    a:= proc(k::nonnegint) local n,i,j; if k=0 then unapply(3^n,n) else unapply((Matrix(k+1, (i,j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 2 else 0 fi)^(n+k))[1,1], n) fi end(8): seq(a(n), n=0..62);
  • Mathematica
    Series[1/(1-x-2*x^9), {x, 0, 62}] // CoefficientList[#, x]& // Drop[#, 8]& (* Jean-François Alcover, Feb 13 2014 *)
  • PARI
    Vec(1/(x^8*(1-x-2*x^9))+O(x^99)) \\ Charles R Greathouse IV, Sep 27 2012

Formula

G.f.: 1/(x^8*(1-x-2*x^9)).
a(n) = 2n+1 if n<=9, else a(n) = a(n-1) + 2a(n-9). - Milan Janjic, Mar 09 2015

A143452 Expansion of 1/(x^k*(1-x-2*x^(k+1))) for k=9.

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 27, 37, 51, 69, 91, 117, 147, 181, 219, 261, 315, 389, 491, 629, 811, 1045, 1339, 1701, 2139, 2661, 3291, 4069, 5051, 6309, 7931, 10021, 12699, 16101, 20379, 25701, 32283, 40421, 50523, 63141, 79003, 99045, 124443, 156645
Offset: 0

Views

Author

Alois P. Heinz, Aug 16 2008

Keywords

Comments

a(n) is also the number of length n ternary words with at least 9 0-digits between any other digits.
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>=19, 3*a(n-19) equals the number of 3-colored compositions of n with all parts >=10, such that no adjacent parts have the same color. - Milan Janjic, Nov 27 2011

Crossrefs

9th column of A143453.

Programs

  • Maple
    a:= proc(k::nonnegint) local n,i,j; if k=0 then unapply(3^n,n) else unapply((Matrix(k+1, (i,j)-> if (i=j-1) or j=1 and i=1 then 1 elif j=1 and i=k+1 then 2 else 0 fi)^(n+k))[1,1], n) fi end(9): seq(a(n), n=0..64);
  • Mathematica
    Series[1/(1-x-2*x^10), {x, 0, 64}] // CoefficientList[#, x]& // Drop[#, 9]& (* Jean-François Alcover, Feb 13 2014 *)
    LinearRecurrence[{1,0,0,0,0,0,0,0,0,2},{1,3,5,7,9,11,13,15,17,19},50] (* Harvey P. Dale, Nov 28 2015 *)

Formula

G.f.: 1/(x^9*(1-x-2*x^10)).
a(n) = 2n+1 if n<=10, else a(n) = a(n-1) + 2a(n-10). - Milan Janjic, Mar 09 2015
Showing 1-7 of 7 results.