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-3 of 3 results.

A003242 Number of compositions of n such that no two adjacent parts are equal (these are sometimes called Carlitz compositions).

Original entry on oeis.org

1, 1, 1, 3, 4, 7, 14, 23, 39, 71, 124, 214, 378, 661, 1152, 2024, 3542, 6189, 10843, 18978, 33202, 58130, 101742, 178045, 311648, 545470, 954658, 1670919, 2924536, 5118559, 8958772, 15680073, 27443763, 48033284, 84069952, 147142465, 257534928, 450748483, 788918212
Offset: 0

Views

Author

E. Rodney Canfield

Keywords

Examples

			From _Joerg Arndt_, Oct 27 2012:  (Start)
The 23 such compositions of n=7 are
[ 1]  1 2 1 2 1
[ 2]  1 2 1 3
[ 3]  1 2 3 1
[ 4]  1 2 4
[ 5]  1 3 1 2
[ 6]  1 3 2 1
[ 7]  1 4 2
[ 8]  1 5 1
[ 9]  1 6
[10]  2 1 3 1
[11]  2 1 4
[12]  2 3 2
[13]  2 4 1
[14]  2 5
[15]  3 1 2 1
[16]  3 1 3
[17]  3 4
[18]  4 1 2
[19]  4 2 1
[20]  4 3
[21]  5 2
[22]  6 1
[23]  7
(End)
		

References

  • Miklos Bona, editor, Handbook of Enumerative Combinatorics, CRC Press, 2015, page 191.

Crossrefs

Row sums of A232396, A241701.
Cf. A241902.
Column k=1 of A261960.
Cf. A048272.
Compositions with adjacent parts coprime are A167606.
The complement is counted by A261983.

Programs

Formula

a(n) = Sum_{k=1..n} A048272(k)*a(n-k), n>1, a(0)=1. - Vladeta Jovovic, Feb 05 2002
G.f.: 1/(1 - Sum_{k>0} x^k/(1+x^k)).
a(n) ~ c r^n where c is approximately 0.456387 and r is approximately 1.750243. (Formula from Knopfmacher and Prodinger reference.) - Franklin T. Adams-Watters, May 27 2010. With better precision: r = 1.7502412917183090312497386246398158787782058181381590561316586... (see A241902), c = 0.4563634740588133495321001859298593318027266156100046548066205... - Vaclav Kotesovec, Apr 30 2014
G.f. is the special case p=2 of 1/(1 - Sum_{k>0} (z^k/(1-z^k) - p*z^(k*p)/(1-z^(k*p)))), see A129922. - Joerg Arndt, Apr 28 2013
G.f.: 1/(1 - x * (d/dx) log(Product_{k>=1} (1 + x^k)^(1/k))). - Ilya Gutkovskiy, Oct 18 2018
Moebius transform of A329738. - Gus Wiseman, Nov 27 2019
For n>=2, a(n) = A128695(n) - A091616(n). - Vaclav Kotesovec, Jul 07 2020

Extensions

More terms from David W. Wilson

A114903 Number of compositions of {1,..,n} such that no two adjacent parts are of equal size (labeled Carlitz compositions), allowing parts to be of size 0.

Original entry on oeis.org

2, 4, 12, 76, 572, 5204, 59340, 782996, 11707324, 197988340, 3720933092, 76811352116, 1730660689580, 42251140165108, 1110607948991028, 31279537587370916, 939737174809843644, 29996522608581396788, 1013814287146517455812, 36168456215193554061044
Offset: 0

Views

Author

Christian G. Bower, Jan 05 2006

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember;
          `if`(n=0, `if`(i=0, 1, 2), add(`if`(i=j, 0, b(n-j,
          `if`(j>n-j, -1, j))*binomial(n, j)), j=0..n))
        end:
    a:= n-> b(n, -1):
    seq(a(n), n=0..25);  # Alois P. Heinz, Sep 04 2015
  • Mathematica
    b[n_, i_] := b[n, i] = If[n == 0, If[i == 0, 1, 2], Sum[If[i == j, 0, b[n - j, If[j > n - j, -1, j]]*Binomial[n, j]], {j, 0, n}]]; a[n_] := b[n, -1]; Table[a[n], {n, 0, 25}] (* Jean-François Alcover, Feb 25 2017, after Alois P. Heinz *)

Formula

E.g.f.: 2*B(x)/(2-B(x)) where B(x) is e.g.f. of A114902.
a(n) ~ c * d^n * n^(n + 1/2), where d = 0.6907524084725166379194613015033714490019226066943600905783847741049876032..., c = 4.71633079866926561049991146534865892961540468329142429184529629611133729... - Vaclav Kotesovec, Sep 21 2019

A298732 Number of compositions (ordered partitions) of n into parts > 1 such that no two adjacent parts are equal (Carlitz compositions).

Original entry on oeis.org

1, 0, 1, 1, 1, 3, 3, 6, 7, 14, 18, 30, 45, 66, 107, 157, 245, 369, 569, 862, 1325, 2020, 3078, 4717, 7183, 10991, 16769, 25626, 39117, 59763, 91264, 139362, 212893, 325060, 496525, 758258, 1158079, 1768634, 2701162, 4125320, 6300303, 9622247, 14695253, 22443451, 34276405, 52348435
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 25 2018

Keywords

Examples

			a(7) = 6 because we have [7], [5, 2], [4, 3], [3, 4], [2, 5] and [2, 3, 2].
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n=0, 1,
          add(`if`(j=i, 0, b(n-j, `if`(j<=n-j, j, 0))), j=2..n))
        end:
    a:= n-> b(n, 0):
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 25 2018
  • Mathematica
    nmax = 45; CoefficientList[Series[1/(1 - Sum[x^k/(1 + x^k), {k, 2, nmax}]), {x, 0, nmax}], x]

Formula

G.f.: 1/(1 - Sum_{k>=2} x^k/(1 + x^k)).
Showing 1-3 of 3 results.