#P1403. [AHOI2005] 约数研究

    ID: 396 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 3 上传者: 标签>数学福建省历届夏令营枚举,暴力概率论,统计

[AHOI2005] 约数研究

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 NN, denoted by f(N)f(N). For example, the divisors of 1212 are 1,2,3,4,6,121, 2, 3, 4, 6, 12, so f(12)=6f(12) = 6. Some values of f(N)f(N) are given below:

NN 11 22 33 44 55 66
f(N)f(N) 11 22 33 22 44

Now, please compute:

i=1nf(i)\sum_{i=1}^n f(i)

Input Format

Input a single integer nn.

Output Format

Output the answer.

3

5

Hint

  • For 20%20\% of the testdata, n5000n \leq 5000.
  • For 100%100\% of the testdata, 1n1061 \leq n \leq 10^6.

Translated by ChatGPT 5