6840.Sum of Divisors

Time Limit: 1s Memory Limit: 512MB

Let $\sigma(n)$ denote the sum of divisors of an integer $n$ . For example, $\sigma(12)=1+2+3+4+6+12=28$ .

Your task is to calculate the sum $\sum_{i=1}^n \sigma(i)$ modulo $10^9+7$ .

Input Format(From the terminal/stdin)

The only input line has an integer $n$ .

  • $1 \le n \le 10^{12}$

Output Format(To the terminal/stdout)

Print $\sum_{i=1}^n \sigma(i)$ modulo $10^9+7$ .

Sample Input

Copy
5
 \n

Sample Output

Copy
21
  \n
Source: CSES, Mathematics, 1082

Submit

请先 登录

© 2025 FAQs