Delta functions

3.6

24 votes
Math Basic, Algorithms, Basic Math, Math
Problem

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}\)

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

1 * 1 / 1 + 1 * 2 / 1 + 2 * 1 / 1 + 2 * 2 / 4 = 6.

Editor Image

?