#P2398. GCD Summation

    ID: 15669 Type: Default 1000ms 256MiB

GCD Summation

GCD Summation

Given a positive integer n, compute the following double summation:

i=1nj=1ngcd(i,j)\sum_{i=1}^{n}\sum_{j=1}^{n}\gcd(i,j)

where (\gcd(a,b)) denotes the greatest common divisor of a and b.

inputFormat

The input consists of a single line containing a positive integer n.

outputFormat

Output one integer that represents the value of the summation.

sample

1
1