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
Mathematics Stack Exchange, What is a sequence run? (answered 2011-12-01)
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
Gus Wiseman, Jun 26 2022
STATUS
approved