摘要:LCM SumTime Limit: 5000 ms Case Time Limit: 5000 ms Memory Limit: 262144 KBSubmit: 4 Accepted: 0 This problem will be judged on SPOJ. Original ID: LCMSUM.[Prev][Next]DescriptionGiven n, calculate the sum LCM(1,n) + LCM(2,n) + .. + LCM(n,n), where LCM(i,n) denotes the Least Common Multiple of the ...
阅读全文
摘要:欧拉函数为什么是积性函数?// 下面是百度上找的错误证明函数的积性即:若m,n互质,则φ(mn)=φ(m)φ(n)。由“m,n互质”可知m,n无公因数,所以φ(m)φ(n)=m(1-1/p1)(1-1/p2)(1-1/p3)…(1-1/pn)·n(1-1/p1')(1-1/p2')(1-1/p3')…(1-1/pn'),//这里已经用了欧拉公式,而欧拉公式是需要先有积性前提才推导的其中p1,p2,p3...pn为m的质因数,p1',p2',p3'...pn'为n的质因数,而m,n无公因数,所以p1,p2,p3...pn,
阅读全文
摘要:GCD AgainTime Limit: 1000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1391Accepted Submission(s): 518Problem DescriptionDo you have spent some time to think and try to solve those unsolved problem after one ACM contest?No? Oh, you must do this when you want to
阅读全文
摘要:RelativesTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 8923Accepted: 4184DescriptionGiven n, a positive integer, how many positive integers less than n are relatively prime to n? Two integers a and b are relatively prime if there are no integers x > 1, y > 0, z > 0 such that a =
阅读全文