All Tracks Math Problem

Delta functions
Tag(s):

Algorithms, Basic Math, Math, Math Basic

Problem
Editorial
Analytics

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.

Time Limit: 5,0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB
Marking Scheme: Marks are awarded when all the testcases pass.
Allowed Languages: Bash, C, C++, C++14, Clojure, C#, D, Erlang, F#, Go, Groovy, Haskell, Java, Java 8, JavaScript(Rhino), JavaScript(Node.js), Julia, Kotlin, Lisp, Lisp (SBCL), Lua, Objective-C, OCaml, Octave, Pascal, Perl, PHP, Python, Python 3, R(RScript), Racket, Ruby, Rust, Scala, Swift, Swift-4.1, TypeScript, Visual Basic

CODE EDITOR

Initializing Code Editor...
Your Rating:

Contributor

This Problem was Asked in

HackerEarth

Challenge Name

November Circuits '19

OTHER PROBLEMS OF THIS CHALLENGE
Уведомления
View All Notifications

?