题意:给定$x, n$满足$1 \leq x, n \leq 1000000$,求$\sum{(x^a-1,x^b-1)}$对$1e9+7$取模后的值,其中$1 \leq a, b \leq n$. 分析:首先不难有$(x^a - 1, x ^ b - 1) = x^{(a,b)}-1$(证明方法可沿欧几里得定理思路),那么我们只需要考虑$(a,b) = d$即可,设$f(d)$为使得$(a, b) = d$的对数,那么不难有$ans = \sum_{d = 1}^{n}{f(d)(x^d-1)…