report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Sum sum sum - FlandreOJ: Flandre Online Judge

Sum sum sum

Time limit: 1000 ms
Memory limit: 256 MB
Let $f(i, j)$ be the sum of all positive divisors that $i$ and $j$ have in common. For example, $f(8, 12) = 1 + 2 + 4 = 7$. Calculate the sum of all $f(i, j)$ for $1 \le i \le j \le n$. In other words, calculate: $$ \sum_{i=1}^{n} \sum_{j=i}^{n} f(i, j) $$ ### Input - A single line containing an integer $n$. ### Output - Print the result of the calculation modulo $10^9 + 7$. ### Constraints - $1 \le n \le 10^{14}$. ### Sample Test Input: ``` 5 ``` Output ``` 33 ```
Basic number theory
Prime number 2
Sieve of Eratosthenes
Segmented sieve
Prime factors
Maximum GCD
Divisors counting
Largest common divisor
Nearest Element
Divisors counting 2
GCD and LCM
GGCD
Square root sum
Square number
Sum sum sum
Topic
Math
Rating 1500
Solution (4) Solution