LCM Sum
Time limit7sMemory limit512 MB
Given n up to 10^18 and k up to 30, compute the sum of lcm(x, x+1, ..., x+k) for x from 1 to n, modulo 10^9+7.
- Level
Hard9 of 10
- Topics
- Number theory, Math, Combinatorics
- Solved
- No attempts yet
Problem
Are you tired of solving problems like computing the prefix sum of some random number theory function? As a terrible problem writer, I present another one for you.
Compute
The answer can be large, so output it modulo .
Input
The first line contains two integers and (, ).
Output
Output one integer: the answer.