版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/Ike940067893/article/details/85042174
题意
求
i=1∑Nj=1∑Nmax(i,j)⋅σ1(ij)
其中
1≤N≤106
1≤T≤5⋅104
σ1(n)表示
n的约数和
题目分析
令
A=∑i=1n∑j=1ii⋅σ1(ij),B=∑i=1ni⋅σ1(i2),则
Ans=2A−B
且有
A=i=1∑ni⋅j=1∑ix∣i∑y∣j∑x⋅j/y[(x,y)=1]=i=1∑ni⋅j=1∑ix∣i∑y∣j∑x⋅j/yd∣(x,y)∑μ(d)=d=1∑nμ(d)d∣x∑xx∣i∑id∣y∑y∣j∑iyj=d=1∑nμ(d)x=1∑⌊dn⌋dxx∣i∑⌊dn⌋diy=1∑⌊dn⌋y∣j∑idydj=d=1∑nμ(d)d2i=1∑⌊dn⌋ix∣i∑xy=1∑⌊dn⌋y∣j∑iy=d=1∑nμ(d)d2i=1∑⌊dn⌋i⋅σ1(i)j=1∑iσ1(j)=d=1∑nμ(d)d2i=1∑⌊dn⌋i⋅σ1(i)⋅Sσ1(i)
B=i=1∑nix∣i∑y∣i∑x⋅i/y[(x,y)=1]=i=1∑ni⋅x∣i∑y∣i∑x⋅i/yd∣(x,y)∑μ(d)=d=1∑nμ(d)d∣i∑id∣x∣i∑d∣y∣i∑x⋅yi=d=1∑nμ(d)i=1∑⌊dn⌋dix∣i∑y∣i∑dx⋅dydi=d=1∑nμ(d)d2i=1∑⌊dn⌋ix∣i∑xy∣i∑yi=d=1∑nμ(d)d2i=1∑⌊dn⌋ix∣i∑xy∣i∑y=d=1∑nμ(d)d2i=1∑⌊dn⌋iσ1(i)2
∴Ans=2A−B=
再次拖更…