Set of numbers with the same number of one in binary representation

55 Views Asked by At

I was looking at a good notation for a set that contains numbers which has the same number of one in binary representation: For example, $$S_1 = \{0^{n-1}1,10^{n-1}...\}$$

is there any standard notation for such sets?

1

There are 1 best solutions below

1
On BEST ANSWER

You can define a function that counts the numbers of 'ones' that are contained in the binary representation of the number, for example, based on https://oeis.org/A000120 :

$$a(0) = 0$$ $$a(2i) = a(i)$$ $$a(2i+1) = a(i) + 1$$

Then you can define the "set of numbers that have $n$ 'ones' in their binary representation" as

$$S_n = \{ i \in \mathbb{N} . a(i) = n \}$$