Skip to main content

Practice · 5 of 5

Sum of Divisors

CHALLENGE
Difficulty: intermediate+25 XP

**Description:** For each query n, print the sum of all positive divisors of n (including 1 and n), modulo 10^9 + 7. **Input:** Line 1: t (1 <= t <= 10^5). Each of the next t lines: n (1 <= n <= 10^12). **Output:** t lines — the divisor sums mod 10^9 + 7. **Example:** 12 -> 28 (1+2+3+4+6+12 = 28).

Back to lesson: Practice: Number Theory Problem Set