|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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.
|
|
LINKS
|
|
|
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
|
Numbers whose binary expansion has distinct runs are A175413.
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.
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|