Preparing NOJ

Coprime

1000ms 262144K

Description:

Suppose you are exploring how to split a positive integer n into the sum of two positive integers $i,j$, and $gcd(i,j)=1$. You want to know how many pairs $(i,j)$ that can meet the conditions. It's so easy, so you need to calculate the sum of number of pairs when n ranges from 1 to N.

Please note that we think $(i,j)$ and $(j,i)$ are different, when $i\neq j$.

Input:

The first line of the input is a positive integer N$(2\leq N\leq 10^5)$

Output:

One integer denotes the number of pairs $(i,j)$

Sample Input:

2

Sample Output:

1

Info

Provider NOJ

Code NOJ2376

Tags

Submitted 297

Passed 82

AC Rate 27.61%

Date 08/13/2019 00:47:12

Related

Nothing Yet