How to write formula for union of terms in binary expansion of some number

54 Views Asked by At

Question of notation: How would one write a formula for the union of terms in the binary expansion of some number? For example, if I have the number 5, the binary expansion is given by:

$$5 = x_52^5 + x_42^4 + x_32^3 + x_22^2+ x_12^1 +x_02^0$$

and $$x_5=0, x_4=0, x_3=0, x_2=1, x_1=0, \text{and}\; x_0=1$$

so we have

$$5 = 0 + 0 + 0 + 4 + 0 + 1$$

Expressing this as a union, we have {0, 1, 4}. How would one write a general formula using $$\bigcup_0^n \text{???}$$