Delta functions

3.6

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

You are given n and xΔy=x×ygcd(x,y)2.

Print the value of ni=1nj=1iΔjmod(109+7).

Input format

  • First line: n

Output format

Print the value of ni=1nj=1iΔjmod(109+7).

Constraints

1n106

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

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

Editor Image

?