How to solve 12995 — Farey Sequence
The problem can be found here: 12995 — Farey Sequence
The final answer will be the $$$summation(phi[i]) - 1$$$ for all $$$i$$$ from $$$1$$$ to $$$n$$$ where $$$phi[i]$$$ is the Euler's totient function.
Codeforces Round 946 Solution Discussion