33OJ
登录 注册

#P2398. GCD SUM

    ID: 3198 远端评测题 1000ms 125MiB 尝试: 19 已通过: 10 显示难度普及+/提高− 上传者: 标签>素数判断,质数,筛法欧拉函数

GCD SUM

Problem Description

Compute

$$\sum_{i=1}^n \sum_{j=1}^n \gcd(i, j)$$. ## Input Format The first line contains an integer $n$. ## Output Format Output a single integer on the first line representing the answer. ```input1 2 ``` ```output1 5 ``` ## Hint For 30% of the testdata, $n \leq 3000$. For 60% of the testdata, $7000 \leq n \leq 7100$. For 100% of the testdata, $n \leq 10^5$. Translated by ChatGPT 5$$