题意:
题意:给一个数,用这个数的因数除以这个数,直到为1时,求除的次数的期望。
设一个数的约数有M个,E[n] = (E[a[1]]+1)/M+(E[a[2]]+1)/M+...+(E[a[M]]+1)/M
一个数最大的约数是它自己。
则有,E[n] = (E[a[1]]+1)/M+(E[a[2]]+1)/M+...+(E[n]+1)/M
(M-1)*E[n]=E[a[1]]+E[a[2]]+...+E[a[M-1]]+M
#include#include #include #include #include #include