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.

A329864 Number of compositions of n with the same runs-resistance as cuts-resistance.

Original entry on oeis.org

1, 0, 0, 0, 0, 2, 5, 10, 17, 27, 68, 107, 217, 420, 884, 1761, 3679, 7469, 15437, 31396, 64369
Offset: 0

Views

Author

Gus Wiseman, Nov 23 2019

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined to be the number of applications required to reach a singleton.
For the operation of shortening all runs by 1, cuts-resistance is defined to be the number of applications required to reach an empty word.

Examples

			The a(5) = 2 through a(8) = 17 compositions:
  (1112)  (1113)   (1114)    (1115)
  (2111)  (1122)   (1222)    (1133)
          (2211)   (2221)    (3311)
          (3111)   (4111)    (5111)
          (11211)  (11122)   (11222)
                   (11311)   (11411)
                   (21112)   (12221)
                   (22111)   (21113)
                   (111121)  (22211)
                   (121111)  (31112)
                             (111131)
                             (111221)
                             (112112)
                             (112211)
                             (122111)
                             (131111)
                             (211211)
For example, the runs-resistance of (111221) is 3 because we have: (111221) -> (321) -> (111) -> (3), while the cuts-resistance is also 3 because we have: (111221) -> (112) -> (1) -> (), so (111221) is counted under a(8).
		

Crossrefs

The version for binary expansion is A329865.
Compositions counted by runs-resistance are A329744.
Compositions counted by cuts-resistance are A329861.
Compositions with runs-resistance = cuts-resistance minus 1 are A329869.

Programs

  • Mathematica
    runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1;
    degdep[q_]:=Length[NestWhileList[Join@@Rest/@Split[#]&,q,Length[#]>0&]]-1;
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],runsres[#]==degdep[#]&]],{n,0,10}]