Problem

Source: Romanian Masters 2017 D1 P1

Tags: algebra, RMM, Additive combinatorics, representation, RMM 2016



(a) Prove that every positive integer $n$ can be written uniquely in the form \[n=\sum_{j=1}^{2k+1}(-1)^{j-1}2^{m_j},\]where $k\geq 0$ and $0\le m_1<m_2\cdots <m_{2k+1}$ are integers. This number $k$ is called weight of $n$. (b) Find (in closed form) the difference between the number of positive integers at most $2^{2017}$ with even weight and the number of positive integers at most $2^{2017}$ with odd weight.