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-10 of 13 results. Next

A351014 Number of distinct runs in the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Feb 07 2022

Keywords

Comments

The n-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 n, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The number 3310 has binary expansion 110011101110 and standard composition (1,3,1,1,2,1,1,2), with runs (1), (3), (1,1), (2), (1,1), (2), of which 4 are distinct, so a(3310) = 4.
		

Crossrefs

Counting not necessarily distinct runs gives A124767.
Using binary expansions instead of standard compositions gives A297770.
Positions of first appearances are A351015.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612.
A345167 ranks alternating compositions, counted by A025047.
A351204 counts partitions where every permutation has all distinct runs.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739, ranked by A351290.
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020, ranked by A175413.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

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

A175413 Those positive integers n that when written in binary, the lengths of the runs of 1 are distinct and the lengths of the runs of 0's are distinct.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 11, 12, 13, 14, 15, 16, 19, 23, 24, 25, 28, 29, 30, 31, 32, 35, 38, 39, 44, 47, 48, 49, 50, 52, 55, 56, 57, 59, 60, 61, 62, 63, 64, 67, 70, 71, 78, 79, 88, 92, 95, 96, 97, 98, 103, 104, 111, 112, 113, 114, 115, 116, 120, 121, 123, 124, 125
Offset: 1

Views

Author

Leroy Quet, May 07 2010

Keywords

Comments

A044813 contains those positive integers that when written in binary, have all run-lengths (of both 0's and 1's) distinct.
A175414 contains those positive integers in A175413 that are not in A044813. (A175414 contains those positive integers that when written in binary, at least one run of 0's is the same length as one run of 1's, even though all run of 0 are of distinct length and all runs of 1's are of distinct length.)
Also numbers whose binary expansion has all distinct runs (not necessarily run-lengths). - Gus Wiseman, Feb 21 2022

Crossrefs

Runs in binary expansion are counted by A005811, distinct A297770.
The complement is A351205.
The version for standard compositions is A351290, complement A351291.
A000120 counts binary weight.
A242882 counts compositions with distinct multiplicities.
A318928 gives runs-resistance of binary expansion.
A325545 counts compositions with distinct differences.
A333489 ranks anti-runs, complement A348612, counted by A003242.
A334028 counts distinct parts in standard compositions.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739.
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.

Programs

  • Maple
    q:= proc(n) uses ListTools; (l-> is(nops(l)=add(
          nops(i), i={Split(`=`, l, 1)}) +add(
          nops(i), i={Split(`=`, l, 0)})))(Bits[Split](n))
        end:
    select(q, [$1..200])[];  # Alois P. Heinz, Mar 14 2022
  • Mathematica
    f[n_] := And@@Unequal@@@Transpose[Partition[Length/@Split[IntegerDigits[n, 2]], 2, 2, {1,1}, 0]]; Select[Range[125], f] (* Ray Chandler, Oct 21 2011 *)
    Select[Range[0,100],UnsameQ@@Split[IntegerDigits[#,2]]&] (* Gus Wiseman, Feb 21 2022 *)
  • Python
    from itertools import groupby, product
    def ok(n):
        runs = [(k, len(list(g))) for k, g in groupby(bin(n)[2:])]
        return len(runs) == len(set(runs))
    print([k for k in range(1, 125) if ok(k)]) # Michael S. Branicky, Feb 22 2022

Extensions

Extended by Ray Chandler, Oct 21 2011

A353849 Number of distinct positive run-sums of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, May 30 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 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

			Composition 462903 in standard order is (1,1,4,7,1,2,1,1,1), with run-sums (2,4,7,1,2,3), of which a(462903) = 5 are distinct.
		

Crossrefs

Counting repeated runs also gives A124767.
Positions of first appearances are A246534.
For distinct runs instead of run-sums we have A351014 (firsts A351015).
A version for partitions is A353835, weak A353861.
Positions of 1's are A353848, counted by A353851.
The version for binary expansion is A353929 (firsts A353930).
The run-sums themselves are listed by A353932, with A353849 distinct terms.
For distinct run-lengths instead of run-sums we have A354579.
A005811 counts runs in binary expansion.
A066099 lists compositions in standard order.
A165413 counts distinct run-lengths in binary expansion.
A297770 counts distinct runs in binary expansion, firsts A350952.
A353847 represents the run-sum transformation for compositions.
A353853-A353859 pertain to composition run-sum trajectory.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

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

A351017 Number of binary words of length n with all distinct run-lengths.

Original entry on oeis.org

1, 2, 2, 6, 6, 10, 22, 26, 38, 54, 114, 130, 202, 266, 386, 702, 870, 1234, 1702, 2354, 3110, 5502, 6594, 9514, 12586, 17522, 22610, 31206, 48630, 60922, 83734, 111482, 149750, 196086, 261618, 336850, 514810, 631946, 862130, 1116654, 1502982, 1916530, 2555734, 3242546
Offset: 0

Views

Author

Gus Wiseman, Feb 07 2022

Keywords

Examples

			The a(0) = 1 through a(6) = 22 words:
  {}  0   00   000   0000   00000   000000
      1   11   001   0001   00001   000001
               011   0111   00011   000011
               100   1000   00111   000100
               110   1110   01111   000110
               111   1111   10000   001000
                            11000   001110
                            11100   001111
                            11110   011000
                            11111   011100
                                    011111
                                    100000
                                    100011
                                    100111
                                    110000
                                    110001
                                    110111
                                    111001
                                    111011
                                    111100
                                    111110
                                    111111
		

Crossrefs

Using binary expansions instead of words gives A032020, ranked by A044813.
The version for partitions is A098859.
The complement is counted by twice A261982.
The version for compositions is A329739, for runs A351013.
For runs instead of run-lengths we have A351016, twice A351018.
The version for patterns is A351292, for runs A351200.
A000120 counts binary weight.
A001037 counts binary Lyndon words, necklaces A000031, aperiodic A027375.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A242882 counts compositions with distinct multiplicities.
A297770 counts distinct runs in binary expansion.
A325545 counts compositions with distinct differences.
A329767 counts binary words by runs-resistance.
A351014 counts distinct runs in standard compositions.
A351204 counts partitions where every permutation has all distinct runs.
A351290 ranks compositions with all distinct runs.

Programs

  • Mathematica
    Table[Length[Select[Tuples[{0,1},n],UnsameQ@@Length/@Split[#]&]],{n,0,10}]
  • Python
    from itertools import groupby, product
    def adrl(s):
        runlens = [len(list(g)) for k, g in groupby(s)]
        return len(runlens) == len(set(runlens))
    def a(n):
        if n == 0: return 1
        return 2*sum(adrl("1"+"".join(w)) for w in product("01", repeat=n-1))
    print([a(n) for n in range(20)]) # Michael S. Branicky, Feb 08 2022

Formula

a(n>0) = 2 * A032020(n).

Extensions

a(25)-a(32) from Michael S. Branicky, Feb 08 2022
More terms from David A. Corneth, Feb 08 2022 using data from A032020

A351015 Smallest k such that the k-th composition in standard order has n distinct runs.

Original entry on oeis.org

0, 1, 5, 27, 155, 1655, 18039, 281975
Offset: 0

Views

Author

Gus Wiseman, Feb 10 2022

Keywords

Comments

The n-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 n, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.
It would be very interesting to have a formula or general construction for a(n). - Gus Wiseman, Feb 12 2022

Examples

			The terms together with their binary expansions and corresponding compositions begin:
       0:                    0  ()
       1:                    1  (1)
       5:                  101  (2,1)
      27:                11011  (1,2,1,1)
     155:             10011011  (3,1,2,1,1)
    1655:          11001110111  (1,3,1,1,2,1,1,1)
   18039:      100011001110111  (4,1,3,1,1,2,1,1,1)
  281975:  1000100110101110111  (4,3,1,2,2,1,1,2,1,1,1)
		

Crossrefs

The version for Heinz numbers and prime multiplicities is A006939.
Counting not necessarily distinct runs gives A113835 (up to zero).
Using binary expansions instead of standard compositions gives A350952.
These are the positions of first appearances in A351014.
A005811 counts runs in binary expansion, distinct A297770.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739, ranked by A351290.
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020, ranked by A175413.
Selected statistics of standard compositions (A066099, reverse A228351):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767.
- Number of distinct parts is A334028.

Programs

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

A351596 Numbers k such that the k-th composition in standard order has all distinct run-lengths.

Original entry on oeis.org

0, 1, 2, 3, 4, 7, 8, 10, 11, 14, 15, 16, 19, 21, 23, 26, 28, 30, 31, 32, 35, 36, 39, 42, 47, 56, 60, 62, 63, 64, 67, 71, 73, 74, 79, 84, 85, 87, 95, 100, 106, 112, 119, 120, 122, 123, 124, 126, 127, 128, 131, 135, 136, 138, 143, 146, 159, 164, 168, 170, 171
Offset: 1

Views

Author

Gus Wiseman, Feb 24 2022

Keywords

Comments

The n-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 n, 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 binary expansions and corresponding compositions begin:
   0:      0  ()
   1:      1  (1)
   2:     10  (2)
   3:     11  (1,1)
   4:    100  (3)
   7:    111  (1,1,1)
   8:   1000  (4)
  10:   1010  (2,2)
  11:   1011  (2,1,1)
  14:   1110  (1,1,2)
  15:   1111  (1,1,1,1)
  16:  10000  (5)
  19:  10011  (3,1,1)
  21:  10101  (2,2,1)
  23:  10111  (2,1,1,1)
		

Crossrefs

The version using binary expansions is A044813.
The version for Heinz numbers and prime multiplicities is A130091.
These compositions are counted by A329739, normal A329740.
The version for runs instead of run-lengths is A351290, counted by A351013.
A005811 counts runs in binary expansion, distinct A297770.
A011782 counts integer compositions.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612.
A345167 ranks alternating compositions, counted by A025047.
A351204 counts partitions where every permutation has all distinct runs.
Counting words with all distinct run-lengths:
- A032020 = binary expansions, for runs A351018.
- A351017 = binary words, for runs A351016.
- A351292 = patterns, for runs A351200.
Selected statistics of standard compositions (A066099, A228351):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767, distinct A351014.
- Heinz number is A333219.
- Number of distinct parts is A334028.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@Length/@Split[stc[#]]&]

A351290 Numbers k such that the k-th composition in standard order has all distinct runs.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 47, 48, 50, 51, 52, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 78
Offset: 1

Views

Author

Gus Wiseman, Feb 10 2022

Keywords

Comments

The n-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 n, 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 binary expansions and corresponding compositions begin:
   0:      0  ()
   1:      1  (1)
   2:     10  (2)
   3:     11  (1,1)
   4:    100  (3)
   5:    101  (2,1)
   6:    110  (1,2)
   7:    111  (1,1,1)
   8:   1000  (4)
   9:   1001  (3,1)
  10:   1010  (2,2)
  11:   1011  (2,1,1)
  12:   1100  (1,3)
  14:   1110  (1,1,2)
  15:   1111  (1,1,1,1)
		

Crossrefs

The version for Heinz numbers and prime multiplicities is A130091.
The version using binary expansions is A175413, complement A351205.
The version for run-lengths instead of runs is A329739.
These compositions are counted by A351013.
The complement is A351291.
A005811 counts runs in binary expansion, distinct A297770.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612.
A345167 ranks alternating compositions, counted by A025047.
A351204 counts partitions where every permutation has all distinct runs.
Counting words with all distinct runs:
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.
Selected statistics of standard compositions:
- Length is A000120.
- Parts are A066099, reverse A228351.
- Sum is A070939.
- Runs are counted by A124767, distinct A351014.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@Split[stc[#]]&]

A351018 Number of integer compositions of n with all distinct even-indexed parts and all distinct odd-indexed parts.

Original entry on oeis.org

1, 1, 2, 3, 6, 9, 18, 27, 46, 77, 122, 191, 326, 497, 786, 1207, 1942, 2905, 4498, 6703, 10574, 15597, 23754, 35043, 52422, 78369, 115522, 169499, 248150, 360521, 532466, 768275, 1116126, 1606669, 2314426, 3301879, 4777078, 6772657, 9677138, 13688079, 19406214
Offset: 0

Views

Author

Gus Wiseman, Feb 09 2022

Keywords

Comments

Also the number of binary words of length n starting with 1 and having all distinct runs (ranked by A175413, counted by A351016).

Examples

			The a(1) = 1 through a(6) = 18 compositions:
  (1)  (2)    (3)    (4)      (5)      (6)
       (1,1)  (1,2)  (1,3)    (1,4)    (1,5)
              (2,1)  (2,2)    (2,3)    (2,4)
                     (3,1)    (3,2)    (3,3)
                     (1,1,2)  (4,1)    (4,2)
                     (2,1,1)  (1,1,3)  (5,1)
                              (1,2,2)  (1,1,4)
                              (2,2,1)  (1,2,3)
                              (3,1,1)  (1,3,2)
                                       (2,1,3)
                                       (2,3,1)
                                       (3,1,2)
                                       (3,2,1)
                                       (4,1,1)
                                       (1,1,2,2)
                                       (1,2,2,1)
                                       (2,1,1,2)
                                       (2,2,1,1)
		

Crossrefs

The case of partitions is A000726.
The version for run-lengths instead of runs is A032020.
These words are ranked by A175413.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A059966 counts Lyndon compositions, necklaces A008965, aperiodic A000740.
A116608 counts compositions by number of distinct parts.
A238130 and A238279 count compositions by number of runs.
A242882 counts compositions with distinct multiplicities.
A297770 counts distinct runs in binary expansion.
A325545 counts compositions with distinct differences.
A329738 counts compositions with equal run-lengths.
A329744 counts compositions by runs-resistance.
A351014 counts distinct runs in standard compositions.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739, ranked by A351290.
- A351016 = binary words, for run-lengths A351017.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.

Programs

  • Mathematica
    Table[Length[Select[Tuples[{0,1},n],#=={}||First[#]==1&&UnsameQ@@Split[#]&]],{n,0,10}]
  • PARI
    P(n)=prod(k=1, n, 1 + y*x^k + O(x*x^n));
    seq(n)=my(p=P(n)); Vec(sum(k=0, n, polcoef(p,k\2,y)*(k\2)!*polcoef(p,(k+1)\2,y)*((k+1)\2)!)) \\ Andrew Howroyd, Feb 11 2022

Formula

a(n>0) = A351016(n)/2.
G.f.: Sum_{k>=0} floor(k/2)! * ceiling(k/2)! * ([y^floor(k/2)] P(x,y)) * ([y^ceiling(k/2)] P(x,y)), where P(x,y) = Product_{k>=1} 1 + y*x^k. - Andrew Howroyd, Feb 11 2022

Extensions

Terms a(21) and beyond from Andrew Howroyd, Feb 11 2022

A351291 Numbers k such that the k-th composition in standard order does not have all distinct runs.

Original entry on oeis.org

13, 22, 25, 45, 46, 49, 53, 54, 59, 76, 77, 82, 89, 91, 93, 94, 97, 101, 102, 105, 108, 109, 110, 115, 118, 141, 148, 150, 153, 156, 162, 165, 166, 173, 177, 178, 180, 181, 182, 183, 187, 189, 190, 193, 197, 198, 201, 204, 205, 209, 210, 213, 214, 216, 217
Offset: 1

Views

Author

Gus Wiseman, Feb 12 2022

Keywords

Comments

The n-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 n, 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 binary expansions and corresponding compositions begin:
  13:     1101  (1,2,1)
  22:    10110  (2,1,2)
  25:    11001  (1,3,1)
  45:   101101  (2,1,2,1)
  46:   101110  (2,1,1,2)
  49:   110001  (1,4,1)
  53:   110101  (1,2,2,1)
  54:   110110  (1,2,1,2)
  59:   111011  (1,1,2,1,1)
  76:  1001100  (3,1,3)
  77:  1001101  (3,1,2,1)
  82:  1010010  (2,3,2)
  89:  1011001  (2,1,3,1)
  91:  1011011  (2,1,2,1,1)
  93:  1011101  (2,1,1,2,1)
  94:  1011110  (2,1,1,1,2)
		

Crossrefs

The version for Heinz numbers of partitions is A130092, complement A130091.
Normal multisets with a permutation of this type appear to be A283353.
Partitions w/o permutations of this type are A351204, complement A351203.
The version using binary expansions is A351205, complement A175413.
The complement is A351290, counted by A351013.
A005811 counts runs in binary expansion, distinct A297770.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has all distinct run-lengths.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612, counted by A003242.
A345167 ranks alternating compositions, counted by A025047.
Counting words with all distinct runs:
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.
Selected statistics of standard compositions (A066099, reverse A228351):
- Length is A000120.
- Sum is A070939.
- Runs are counted by A124767, distinct A351014.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],!UnsameQ@@Split[stc[#]]&]

A353929 Number of distinct sums of runs (of 0's or 1's) in the binary expansion of n.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Jun 26 2022

Keywords

Comments

Assuming the binary digits are not all 1, this is one more than the number of different lengths of runs of 1's in the binary expansion of n.

Examples

			The binary expansion of 183 is (1,0,1,1,0,1,1,1), with runs (1), (0), (1,1), (0), (1,1,1), with sums 1, 0, 2, 0, 3, of which four are distinct, so a(183) = 4.
		

Crossrefs

For lengths of all runs we have A165413, firsts A165933.
Numbers whose binary expansion has distinct runs are A175413.
For runs instead of run-sums we have A297770, firsts A350952.
For prime indices we have A353835, weak A353861, firsts A006939.
For standard compositions we have A353849, firsts A246534.
Positions of first appearances are A353930.
A005811 counts runs in binary expansion.
A044813 lists numbers with distinct run-lengths in binary expansion.
A318928 gives runs-resistance of binary expansion.
A351014 counts distinct runs in standard compositions.

Programs

  • Mathematica
    Table[Length[Union[Total/@Split[IntegerDigits[n,2]]]],{n,0,100}]
  • Python
    from itertools import groupby
    def A353929(n): return len(set(sum(map(int,y[1])) for y in groupby(bin(n)[2:]))) # Chai Wah Wu, Jun 26 2022
Showing 1-10 of 13 results. Next