Harmonic Lemma : H(n) - UVA 11526

For a given $n$ , calculate $\sum_{i=1}^{n}{\lfloor \frac{n}{i} \rfloor}$ The main idea of this problem is there are maximum $2\sqrt{n}$ different values of $\lfloor \frac{n}{i} \rfloor$. [This is also known as Harmonic lemma] [But why?] click to hide Case 1: $x\le \sqrt{n}$ Hence, if we divide $n$ with $1\le i\le x$, number of values of $\lfloor \frac{n}{i} \rfloor$ will be at most $x$ (because, if all values were different, even then there will be $x$ values).
Read more →

Prime Factor Love - Toph

Find sum of sum-of-divisor from 1 to n
Read more →