[go: up one dir, main page]

login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A353929
Number of distinct sums of runs (of 0's or 1's) in the binary expansion of n.
8
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,3
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.
EXAMPLE
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.
MATHEMATICA
Table[Length[Union[Total/@Split[IntegerDigits[n, 2]]]], {n, 0, 100}]
PROG
(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
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.
Sequence in context: A323406 A160520 A235708 * A297770 A330617 A343240
KEYWORD
base,nonn
AUTHOR
Gus Wiseman, Jun 26 2022
STATUS
approved