求∑1<=i<=n∑1<=j<=ngcd(i,j) % P P = 10^9 + 7 2 <= n <= 10^10 这道题,明显就是杜教筛 推一下公式: 利用∑d|nphi(d) = n ans = ∑1<=i<=n∑1<=j<=n∑d|(i,j)phi(d) = ∑1<=d<=n∑1<=i<=n∑1<=j<=n[d|(i,j)]phi(d) = ∑1<=d<=nphi(d)∑1<=i<…
题目描述 求∑i=1n∑j=1n(i,j) mod (1e9+7)n<=1010\sum_{i=1}^n\sum_{j=1}^n(i,j)~mod~(1e9+7)\\n<=10^{10}i=1∑nj=1∑n(i,j) mod (1e9+7)n<=1010 题目分析 乍一看十分像裸莫比乌斯反演,然而nnn的范围让人望而却步 于是先变化一下式子 Ans=∑i=1n∑j=1n(i,j)Ans=\sum_{i=1}^n\sum_{j=1}^n(i,j)Ans=i=1∑nj=1∑n(i,j…