Delta functions
Practice
3.6 (24 votes)
Math basic
Algorithms
Basic math
Math
Problem
88% Success 7808 Attempts 50 Points 5s Time Limit 256MB Memory 1024 KB Max Code
You are given \(n\) and \(x \Delta y = \frac{x \times y}{\gcd(x, y) ^ 2}\).
Print the value of \(\sum_{i = 1}^{n} \sum_{j = 1}^n i \Delta j \mod (10^9 + 7)\).
Input format
- First line: \(n\)
Output format
Print the value of \(\sum_{i = 1}^n \sum_{j = 1}^n i \Delta j \mod (10^9 + 7)\).
Constraints
\(1\le n\le10^{6}\)
Sample Input
2
Sample Output
6
Explanation
1 * 1 / 1 + 1 * 2 / 1 + 2 * 1 / 1 + 2 * 2 / 4 = 6.
Code Editor
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Submissions
Please login to view your submissions
Similar Problems
Points:50
17 votes
Tags:
Basic MathC++Math
Points:50
16 votes
Tags:
MathematicsMedium-HardMathematicsMathamatics
Points:50
2 votes
Tags:
C++Basic MathMathamaticsMath
Editorial
Login to unlock the editorial
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor