Binary order on the discrete cube (source code)

= Binary order on the discrete cube

Identify a vertex $(x_1,\ldots,x_n)$ with the integer $\sum_{i=1}^n2^{i-1}x_i$. Binary order is increasing order of these integers. Its initial segment of size $a$ has $F(a)=\sum_{j=0}^{a-1}s_2(j)$ induced edges, where $s_2(j)$ is the <Hamming weight> of the binary expansion of $j$.