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

A333627 The a(n)-th composition in standard order is the sequence of run-lengths of the n-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 2, 1, 3, 3, 4, 1, 3, 2, 6, 3, 7, 5, 8, 1, 3, 3, 6, 3, 5, 7, 12, 3, 7, 6, 14, 5, 11, 9, 16, 1, 3, 3, 6, 2, 7, 7, 12, 3, 7, 4, 10, 7, 15, 13, 24, 3, 7, 7, 14, 7, 13, 15, 28, 5, 11, 10, 22, 9, 19, 17, 32, 1, 3, 3, 6, 3, 7, 7, 12, 3, 5, 6, 14, 7, 15, 13
Offset: 0

Views

Author

Gus Wiseman, Mar 30 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The standard compositions and their run-lengths:
       0 ~ () -> () ~ 0
      1 ~ (1) -> (1) ~ 1
      2 ~ (2) -> (1) ~ 1
     3 ~ (11) -> (2) ~ 2
      4 ~ (3) -> (1) ~ 1
     5 ~ (21) -> (11) ~ 3
     6 ~ (12) -> (11) ~ 3
    7 ~ (111) -> (3) ~ 4
      8 ~ (4) -> (1) ~ 1
     9 ~ (31) -> (11) ~ 3
    10 ~ (22) -> (2) ~ 2
   11 ~ (211) -> (12) ~ 6
    12 ~ (13) -> (11) ~ 3
   13 ~ (121) -> (111) ~ 7
   14 ~ (112) -> (21) ~ 5
  15 ~ (1111) -> (4) ~ 8
     16 ~ (5) -> (1) ~ 1
    17 ~ (41) -> (11) ~ 3
    18 ~ (32) -> (11) ~ 3
   19 ~ (311) -> (12) ~ 6
		

Crossrefs

Positions of first appearances are A333630.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- The partial sums from the right are A048793.
- The sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Equal runs are counted by A124767.
- Strict compositions are ranked by A233564.
- The partial sums from the left are A272020.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Runs-resistance is A333628.
- First appearances of run-resistances are A333629.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Total[2^(Accumulate[Reverse[Length/@Split[stc[n]]]])]/2,{n,0,30}]

Formula

A000120(n) = A070939(a(n)).
A000120(a(n)) = A124767(n).

A333628 Runs-resistance of the n-th composition in standard order. Number of steps taking run-lengths to reduce the n-th composition in standard order to a singleton.

Original entry on oeis.org

0, 0, 1, 0, 2, 2, 1, 0, 2, 1, 3, 2, 2, 3, 1, 0, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 4, 3, 4, 3, 1, 0, 2, 2, 3, 1, 2, 2, 3, 2, 2, 1, 2, 2, 2, 3, 3, 2, 2, 2, 4, 2, 3, 2, 4, 3, 4, 2, 3, 3, 4, 3, 1, 0, 2, 2, 3, 2, 2, 2, 3, 2, 3, 3, 4, 2, 2, 3, 3, 2, 2, 2, 4, 3, 3, 4
Offset: 1

Views

Author

Gus Wiseman, Mar 31 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.

Examples

			Starting with 13789 and repeatedly applying A333627 gives: 13789 -> 859 -> 110 -> 29 -> 11 -> 6 -> 3 -> 2, corresponding to the compositions: (1,2,2,1,1,2,1,1,2,1) -> (1,2,2,1,2,1,1) -> (1,2,1,1,2) -> (1,1,2,1) -> (2,1,1) -> (1,2) -> (1,1) -> (2), so a(13789) = 7.
		

Crossrefs

Number of times applying A333627 to reach a power of 2, starting with n.
Positions of first appearances are A333629.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- The partial sums from the right are A048793.
- The sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Equal runs are counted by A124767.
- Strict compositions are ranked by A233564.
- The partial sums from the left are A272020.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- First appearances for specified run-lengths are A333630.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    runsres[q_]:=Length[NestWhileList[Length/@Split[#]&,q,Length[#]>1&]]-1;
    Table[runsres[stc[n]],{n,100}]

A333769 Irregular triangle read by rows where row k is the sequence of run-lengths of the k-th composition in standard order.

Original entry on oeis.org

1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 1, 2, 1, 1, 3, 1, 5, 1, 1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 3, 2, 2, 1, 1, 1, 1, 1, 1
Offset: 0

Views

Author

Gus Wiseman, Apr 10 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The standard compositions and their run-lengths:
   0:        () -> ()
   1:       (1) -> (1)
   2:       (2) -> (1)
   3:     (1,1) -> (2)
   4:       (3) -> (1)
   5:     (2,1) -> (1,1)
   6:     (1,2) -> (1,1)
   7:   (1,1,1) -> (3)
   8:       (4) -> (1)
   9:     (3,1) -> (1,1)
  10:     (2,2) -> (2)
  11:   (2,1,1) -> (1,2)
  12:     (1,3) -> (1,1)
  13:   (1,2,1) -> (1,1,1)
  14:   (1,1,2) -> (2,1)
  15: (1,1,1,1) -> (4)
  16:       (5) -> (1)
  17:     (4,1) -> (1,1)
  18:     (3,2) -> (1,1)
  19:   (3,1,1) -> (1,2)
For example, the 119th composition is (1,1,2,1,1,1), so row 119 is (2,1,3).
		

Crossrefs

Row sums are A000120.
Row lengths are A124767.
Row k is the A333627(k)-th standard composition.
A triangle counting compositions by runs-resistance is A329744.
All of the following pertain to compositions in standard order (A066099):
- Partial sums from the right are A048793.
- Sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Strict compositions are A233564.
- Partial sums from the left are A272020.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Heinz number is A333219.
- Runs-resistance is A333628.
- First appearances of run-resistances are A333629.
- Combinatory separations are A334030.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length/@Split[stc[n]],{n,0,30}]

A333629 Least k such that the runs-resistance of the k-th composition in standard order is n.

Original entry on oeis.org

1, 3, 5, 11, 27, 93, 859, 13789, 1530805, 1567323995
Offset: 0

Views

Author

Gus Wiseman, Mar 31 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.
For the operation of taking the sequence of run-lengths of a finite sequence, runs-resistance is defined as the number of applications required to reach a singleton.

Examples

			The sequence together with the corresponding compositions begins:
        1: (1)
        3: (1,1)
        5: (2,1)
       11: (2,1,1)
       27: (1,2,1,1)
       93: (2,1,1,2,1)
      859: (1,2,2,1,2,1,1)
    13789: (1,2,2,1,1,2,1,1,2,1)
  1530805: (2,1,1,2,2,1,2,1,1,2,1,2,2,1)
For example, starting with 13789 and repeatedly applying A333627 gives: 13789 -> 859 -> 110 -> 29 -> 11 -> 6 -> 3 -> 2, corresponding to the compositions: (1,2,2,1,1,2,1,1,2,1) -> (1,2,2,1,2,1,1) -> (1,2,1,1,2) -> (1,1,2,1) -> (2,1,1) -> (1,2) -> (1,1) -> (2).
		

Crossrefs

Positions of first appearances in A333628 = number of times applying A333627 to reach a power of 2, starting with n.
A subsequence of A333630.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- The partial sums from the right are A048793.
- The sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Equal runs are counted by A124767.
- Strict compositions are ranked by A233564.
- The partial sums from the left are A272020.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.

Programs

  • Mathematica
    nn=1000;
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    stcrun[n_]:=Total[2^(Accumulate[Reverse[Length/@Split[stc[n]]]])]/2;
    seq=Table[Length[NestWhileList[stcrun,n,Length[stc[#]]>1&]]-1,{n,nn}];
    Table[Position[seq,i][[1,1]],{i,Union[seq]}]

Extensions

a(9) from Amiram Eldar, Aug 04 2025

A337565 Irregular triangle read by rows where row k is the sequence of maximal anti-run lengths in the k-th composition in standard order.

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, 1, 2, 3, 1, 2, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 1, 2, 3, 2, 1, 1, 2, 3, 2, 1, 3, 1, 1, 2, 1, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 3, 3, 2, 1, 1, 2, 3, 1, 1, 1, 1, 2, 1, 3, 4, 2, 2, 2, 1, 1, 1, 2, 3, 3
Offset: 0

Views

Author

Gus Wiseman, Sep 07 2020

Keywords

Comments

An anti-run is a sequence with no adjacent equal parts.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The first column below lists various selected n; the second column gives the corresponding composition; the third column gives the corresponding row of the triangle, i.e., the anti-run lengths.
    1:           (1) -> (1)
    3:         (1,1) -> (1,1)
    5:         (2,1) -> (2)
    7:       (1,1,1) -> (1,1,1)
   11:       (2,1,1) -> (2,1)
   13:       (1,2,1) -> (3)
   14:       (1,1,2) -> (1,2)
   15:     (1,1,1,1) -> (1,1,1,1)
   23:     (2,1,1,1) -> (2,1,1)
   27:     (1,2,1,1) -> (3,1)
   29:     (1,1,2,1) -> (1,3)
   30:     (1,1,1,2) -> (1,1,2)
   31:   (1,1,1,1,1) -> (1,1,1,1,1)
   43:     (2,2,1,1) -> (1,2,1)
   45:     (2,1,2,1) -> (4)
   46:     (2,1,1,2) -> (2,2)
   47:   (2,1,1,1,1) -> (2,1,1,1)
   55:   (1,2,1,1,1) -> (3,1,1)
   59:   (1,1,2,1,1) -> (1,3,1)
   61:   (1,1,1,2,1) -> (1,1,3)
   62:   (1,1,1,1,2) -> (1,1,1,2)
   63: (1,1,1,1,1,1) -> (1,1,1,1,1,1)
For example, the 119th composition is (1,1,2,1,1,1), with maximal anti-runs ((1),(1,2,1),(1),(1)), so row 119 is (1,3,1,1).
		

Crossrefs

A000120 gives row sums.
A333381 gives row lengths.
A333769 is the version for runs.
A003242 counts anti-run compositions.
A011782 counts compositions.
A106351 counts anti-run compositions by length.
A329744 is a triangle counting compositions by runs-resistance.
A333755 counts compositions by number of runs.
All of the following pertain to compositions in standard order (A066099):
- Sum is A070939.
- Adjacent equal pairs are counted by A124762.
- Runs are counted by A124767.
- Strict compositions are A233564.
- Constant compositions are A272919.
- Patterns are A333217.
- Heinz number is A333219.
- Anti-runs are counted by A333381.
- Anti-run compositions are A333489.
- Runs-resistance is A333628.
- Combinatory separations are A334030.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length/@Split[stc[n],UnsameQ],{n,0,50}]
Showing 1-5 of 5 results.