摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3501一道数学题,不是很难,老题了。但从中学到了不少东西。 1:if gcd(n,i) == 1 then gcd(n,n-i) == 1 so sum(n) = n * phi(n) / 2; //sum(n): 比n小的和n互质的数的和 phi(n): 比n小的跟n互质的数的个数2:n = P1^n1 * P... 阅读全文