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.

A353930 Smallest number whose binary expansion has n distinct run-sums.

Original entry on oeis.org

1, 2, 11, 183, 5871, 375775, 48099263, 12313411455, 6304466665215, 6455773865180671, 13221424875890015231, 54154956291645502388223, 443637401941159955564326911, 7268555193403964711965932118015, 238176016577461115681699663643131903, 15609103422420491677315869156516292427775
Offset: 1

Views

Author

Gus Wiseman, Jun 07 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).

Examples

			The terms, binary expansions, and standard compositions begin:
       1:                    1  (1)
       2:                   10  (2)
      11:                 1011  (2,1,1)
     183:             10110111  (2,1,2,1,1,1)
    5871:        1011011101111  (2,1,2,1,1,2,1,1,1,1)
  375775:  1011011101111011111  (2,1,2,1,1,2,1,1,1,2,1,1,1,1,1)
		

Crossrefs

Essentially the same as A215203.
For prime indices instead of binary expansion we have A006939.
For lengths instead of sums of runs we have A165933 = firsts in A165413.
Numbers whose binary expansion has all distinct runs are A175413.
For standard compositions we have A246534, firsts of A353849.
For runs instead of run-sums we have A350952, firsts of A297770.
These are the positions of first appearances in A353929.
A005811 counts runs in binary expansion.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A351014 counts distinct runs in standard compositions.
A353835 counts partitions with all distinct run-sums, weak A353861.
A353864 counts rucksack partitions.

Programs

  • Mathematica
    qe=Table[Length[Union[Total/@Split[IntegerDigits[n,2]]]],{n,1,10000}];
    Table[Position[qe,i][[1,1]],{i,Max@@qe}]
  • PARI
    a(n) = {my(t=1); if(n==2, t<<=1, for(k=3, n, t = (t<Andrew Howroyd, Jan 01 2023

Extensions

Offset corrected and terms a(7) and beyond from Andrew Howroyd, Jan 01 2023

A354907 Number of distinct sums of contiguous constant subsequences (partial runs) of the n-th composition in standard order.

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 2, 3, 1, 2, 2, 2, 2, 2, 2, 4, 1, 2, 2, 3, 2, 3, 2, 3, 2, 2, 3, 2, 3, 2, 3, 5, 1, 2, 2, 3, 2, 3, 3, 3, 2, 3, 3, 3, 3, 2, 2, 4, 2, 2, 3, 3, 3, 3, 2, 3, 3, 3, 3, 2, 3, 3, 4, 6, 1, 2, 2, 3, 2, 3, 3, 4, 2, 3, 3, 3, 2, 3, 3, 4, 2, 3, 2, 3, 3, 4, 3
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.
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).

Examples

			Composition number 981 in standard order is (1,1,1,2,2,2,1), with partial runs (1), (2), (1,1), (2,2), (1,1,1), (2,2,2), with distinct sums {1,2,3,4,6}, so a(981) = 5.
		

Crossrefs

Positions of 1's are A000051.
Positions of first appearances are A000079.
The standard compositions used here are A066099, run-sums A353847/A353932.
If we allow any subsequence we get A334968.
The case of full runs is A353849, firsts A246534.
A version for nonempty partitions is A353861, full A353835.
Counting all distinct runs (instead of their distinct sums) gives A354582.
A124767 counts runs in standard compositions.
A238279 and A333755 count compositions by number of runs.
A330036 counts distinct partial runs of prime indices, full A005811.
A351014 counts distinct runs of standard compositions, firsts A351015.
A353853-A353859 pertain to composition run-sum trajectory.
A353860 counts collapsible compositions.
A354584 lists run-sums of prime indices, rows ranked by A353832.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    pre[y_]:=NestWhileList[Most,y,Length[#]>1&];
    Table[Length[Union[Total/@Join@@pre/@Split[stc[n]]]],{n,0,100}]

A354908 Numbers k such that the k-th composition in standard order (graded reverse-lexicographic, A066099) is collapsible.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 10, 11, 14, 15, 16, 31, 32, 36, 39, 42, 43, 46, 47, 58, 59, 60, 62, 63, 64, 127, 128, 136, 138, 139, 142, 143, 168, 170, 171, 174, 175, 184, 186, 187, 190, 191, 232, 234, 235, 238, 239, 248, 250, 251, 254, 255, 256, 292, 295, 316, 319, 484
Offset: 1

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.
If a collapse is an adding together of some partial run of an integer composition c, we say c is collapsible iff by some sequence of collapses it can be reduced to a single part. An example of such a sequence of collapses is (11132112) -> (332112) -> (33222) -> (6222) -> (66) -> (n), which shows that (11132112) is a collapsible composition of 12.

Examples

			The terms together with their corresponding compositions begin:
  1:(1)  2:(2)   4:(3)     8:(4)     16:(5)      32:(6)
         3:(11)  7:(111)  10:(22)    31:(11111)  36:(33)
                          11:(211)               39:(3111)
                          14:(112)               42:(222)
                          15:(1111)              43:(2211)
                                                 46:(2112)
                                                 47:(21111)
                                                 58:(1122)
                                                 59:(11211)
                                                 60:(1113)
                                                 62:(11112)
                                                 63:(111111)
		

Crossrefs

The standard compositions used here are A066099, run-sums A353847/A353932.
The version for Heinz numbers of partitions is A300273, counted by A275870.
These compositions are counted by A353860.
A003242 counts anti-run compositions, ranked by A333489, complement A261983.
A011782 counts compositions.
A124767 counts runs in standard compositions.
A238279 and A333755 count compositions by number of runs.
A334968 counts distinct sums of subsequences of standard compositions.
A351014 counts distinct runs of standard compositions, firsts A351015.
A353853-A353859 pertain to composition run-sum trajectory.
A354582 counts distinct partial runs of standard compositions, sums A354907.

Programs

  • Mathematica
    repcams[q_List]:=repcams[q]=Union[{q},If[UnsameQ@@q,{},Union@@repcams/@Union[Insert[Drop[q,#],Plus@@Take[q,#],First[#]]&/@Select[Tuples[Range[Length[q]],2],And[Less@@#,SameQ@@Take[q,#]]&]]]];
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],MemberQ[repcams[stc[#]],{_}]&]
Showing 1-3 of 3 results.