P1403 [AHOI2005] Divisor Research
Description
The scientists’ expedition on the planet Samuel has yielded abundant energy reserves, making long computations on the large computer Samuel II in the space station possible. Because of his solid performance last year, Xiaolian was allowed to use Samuel II for mathematical research.
Xiaolian is studying problems related to divisors. He counts the number of divisors of each positive integer $N$, denoted by $f(N)$. For example, the divisors of $12$ are $1, 2, 3, 4, 6, 12$, so $f(12) = 6$. Some values of $f(N)$ are given below:
| $N$ | $1$ | $2$ | $3$ | $4$ | $5$ | $6$ |
| ------ | ---- | ---- | ---- | ---- | ---- | ---- |
| $f(N)$ | $1$ | $2$ | $2$ | $3$ | $2$ | $4$ |
Now, please compute:
$$
\sum_{i=1}^n f(i)
$$
Input Format
Input a single integer $n$.
Output Format
Output the answer.
Explanation/Hint
- For $20\%$ of the testdata, $n \leq 5000$.
- For $100\%$ of the testdata, $1 \leq n \leq 10^6$.
Translated by ChatGPT 5