Möbius Madness
Time limit2.5sMemory limit512 MB
Given N, L, and K, compute the sum over d from 1 to N of mu(L*d) times floor(N/d) to the power K, modulo 1e9+7.
- Level
Hard8 of 10
- Topics
- Math, Number theory, Divide and conquer
- Solved
- No attempts yet
Problem
The Möbius function is one of the important multiplicative functions in number theory.
For a positive integer , is defined as follows.
- If is squarefree and has prime factors, then . In particular, .
- If is not squarefree, then .
Given positive integers , , and , compute the following value. Since the value can be large, print it modulo .
Input
The input is a single line containing the positive integers , , and , in that order.
The input satisfies , , and .
Output
Print the value of the sum above modulo .