A353929 Number of distinct sums of runs (of 0's or 1's) in the binary expansion of n.
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
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.
Links
- Mathematics Stack Exchange, What is a sequence run? (answered 2011-12-01)
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.
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
Comments