数学--数论--HDU 2582 F(N) 暴力打表找规律
This time I need you to calculate the f(n) . (3<=n<=1000000)
f(n)= Gcd(3)+Gcd(4)+…+Gcd(i)+…+Gcd(n).
Gcd(n)=gcd(C[n][1],C[n][2],……,C[n][n-1])
C[n][k] means the number of way to choose k things from n some things.
gcd(a,b) means the greatest common divisor of a and b.
Input
There are several test case. For each test case:One integer n(3<=n<=1000000). The end of the in put file is EOF.
Output
For each test case:
The output consists of one line with one integer f(n).
Sample Input
3
26983
Sample Output
3
37556486
題目就是這么短小精悍,這題我實在不知道怎么寫,然后也不會數論的推理,我就打了表,發現跟質數的關系很大,就順著推了一下, 就過了。
總結
以上是生活随笔為你收集整理的数学--数论--HDU 2582 F(N) 暴力打表找规律的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数学--数论--HDU1825(积性函数
- 下一篇: 数学--数论--HDU 2197 本原串