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-6 of 6 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}]

A353743 Least number with run-sum trajectory of length k; a(0) = 1.

Original entry on oeis.org

1, 2, 4, 12, 84, 1596, 84588, 11081028, 3446199708, 2477817590052, 4011586678294188, 14726534696017964148, 120183249654202605411828, 2146833388573021140471483564, 83453854313999050793547980583372, 7011542477899258250521520684673165324
Offset: 0

Views

Author

Gus Wiseman, Jun 11 2022

Keywords

Comments

Every sequence can be uniquely split into a sequence of non-overlapping runs. For example, the runs of (2,2,1,1,1,3,2,2) are ((2,2),(1,1,1),(3),(2,2)), with sums (4,3,3,4). The run-sum trajectory is obtained by repeatedly taking the run-sum transformation (A353832, A353847) until a squarefree number is reached. For example, the trajectory 12 -> 9 -> 7 corresponds to the partitions (2,1,1) -> (2,2) -> (4).

Examples

			The terms together with their prime indices begin:
      1: {}
      2: {1}
      4: {1,1}
     12: {1,1,2}
     84: {1,1,2,4}
   1596: {1,1,2,4,8}
  84588: {1,1,2,4,8,16}
		

Crossrefs

The ordered version is A072639, for run-lengths A333629.
The version for run-lengths is A325278, firsts in A182850 or A323014.
The run-sum trajectory is the iteration of A353832.
The first length-k row of A353840 has index a(k).
Other sequences pertaining to this trajectory are A353841-A353846.
A001222 counts prime factors, distinct A001221.
A056239 adds up prime indices, row sums of A112798 and A296150.
A300273 ranks collapsible partitions, counted by A275870.
A353833 ranks partitions with all equal run-sums, counted by A304442.
A353835 counts distinct run-sums of prime indices, weak A353861.
A353838 ranks partitions with all distinct run-sums, counted by A353837.
A353866 ranks rucksack partitions, counted by A353864.

Programs

  • Mathematica
    Join[{1,2},Table[2*Product[Prime[2^k],{k,0,n}],{n,0,6}]]

Formula

a(n > 1) = 2 * Product_{k=0..n-2} prime(2^k).
a(n > 0) = 2 * A325782(n).

A333630 Least STC-number of a composition whose sequence of run-lengths has STC-number n.

Original entry on oeis.org

0, 1, 3, 5, 7, 14, 11, 13, 15, 30, 43, 29, 23, 46, 27, 45, 31, 62, 122, 61, 87, 117, 59, 118, 47, 94, 107, 93, 55, 110, 91, 109, 63, 126, 250, 125, 343, 245, 123, 246, 175, 350, 235, 349, 119, 238, 347, 237, 95, 190, 378, 189, 215, 373, 187, 374, 111, 222, 363
Offset: 0

Views

Author

Gus Wiseman, Mar 31 2020

Keywords

Comments

All terms belong to A003754.
A composition of n is a finite sequence of positive integers summing to n. The composition with STC-number k (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 sequence together with the corresponding compositions begins:
   0: ()
   1: (1)
   3: (1,1)
   5: (2,1)
   7: (1,1,1)
  14: (1,1,2)
  11: (2,1,1)
  13: (1,2,1)
  15: (1,1,1,1)
  30: (1,1,1,2)
  43: (2,2,1,1)
  29: (1,1,2,1)
  23: (2,1,1,1)
  46: (2,1,1,2)
  27: (1,2,1,1)
  45: (2,1,2,1)
  31: (1,1,1,1,1)
  62: (1,1,1,1,2)
		

Crossrefs

Position of first appearance of n in A333627.
All of the following pertain to compositions in standard order (A066099):
- The length is A000120.
- Compositions without terms > 2 are A003754.
- Compositions without ones are ranked by A022340.
- 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;
    seq=Table[Total[2^(Accumulate[Reverse[Length/@Split[stc[n]]]])]/2,{n,0,1000}];
    Table[Position[seq,i][[1,1]],{i,First[Split[Union[seq],#1+1==#2&]]}]-1

A354906 Position of first appearance of n in A354579 = Number of distinct run-lengths of standard compositions.

Original entry on oeis.org

0, 1, 11, 119, 5615, 251871
Offset: 0

Views

Author

Gus Wiseman, Jun 23 2022

Keywords

Comments

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 terms together with their corresponding compositions begin:
       0: ()
       1: (1)
      11: (2,1,1)
     119: (1,1,2,1,1,1)
    5615: (2,2,1,1,1,2,1,1,1,1)
  251871: (1,1,1,2,2,1,1,1,1,2,1,1,1,1,1)
		

Crossrefs

The standard compositions used here are A066099, run-sums A353847/A353932.
The version for partitions is A006939, for run-sums A002110.
For run-sums instead of run-lengths we have A246534 (firsts in A353849).
For runs instead of run-lengths we have A351015 (firsts in A351014).
These are the positions of first appearances in A354579.
A005811 counts runs in binary expansion.
A333627 ranks the run-lengths of standard compositions.
A351596 ranks compositions with distinct run-lengths, counted by A329739.
A353744 ranks compositions with equal run-lengths, counted by A329738.
A353852 ranks compositions with distinct run-sums, counted by A353850.
A353853-A353859 are sequences pertaining to composition run-sum trajectory.
A353860 counts collapsible compositions.

Programs

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