Solution (source code)

= Solution

Let $2^k\le n\lt 2^{k+1}$. In the reduced common-denominator expression for $H_n$, the term $1/2^k$ is the unique term whose denominator contains the largest power $2^k$; after multiplication by the least common multiple it contributes an odd integer while all other terms contribute even integers. Thus the numerator is odd and the denominator remains even, so $H_n$ is not an integer.