G - Happy 2004 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 1452 Description Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to dete…
Happy 2004 题意:s为2004^x的因子和,求s%29.     (题于文末) 知识点: 素因子分解:n = p1 ^ e1 * p2 ^ e2 *..........*pn ^ en 因子和:    Sum=(p1^0+p1^1-.p1^e1)*(p2^0+p2^1-p2^e2)--(pn^0+-pn^en) =; 积性函数:s(xy)=s(x)*s(y)    (比如:幂函数,因子和,欧拉函数,莫比乌斯函数) 对于正整数n的一个算术函数 f(n),若f(1)=1,且当a,b互质时f…
Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the rest of the division of S by 29). Take X = 1 for an example. The positive integer divisors of 2004^1 are 1, 2, 3,…
Problem Description Considera positive integer X,and let S be the sum of all positive integer divisors of2004^X. Your job is to determine S modulo 29 (the rest of the division of S by29). Take X = 1 for an example. The positive integer divisors of 20…
题目意思:2004^x的所有正因数的和(S)对29求余:输出结果: 原题链接 题目解析:解析参照来源:点击打开链接 因子和 6的因子是1,2,3,6; 6的因子和是s(6)=1+2+3+6=12; 20的因子是1,2,4,5,10,20; 20的因子和是s(20)=1+2+4+5+10+20=42; 2的因子是1,2; 2的因子和是s(2)=1+2=3; 3的因子是1,3; 3的因子和是s(3)=1+3=4; 4的因子和是 s(4)=1+2+4=7; 5的因子和是 s(5)=1+5=6; s(6…
题目链接 题意 : 给你一个X,让你求出2004的X次方的所有因子之和,然后对29取余. 思路 : 原来这就是积性函数,点这里这里这里,这里讲得很详细. 在非数论的领域,积性函数指所有对于任何a,b都有性质f(ab)=f(a)f(b)的函数. 在数论中的积性函数:对于正整数n的一个算术函数 f(n),若f(1)=1,且当a,b互质时f(ab)=f(a)f(b),在数论上就称它为积性函数. 若对于某积性函数 f(n),就算a, b不互质,也有f(ab)=f(a)f(b),则称它为完全积性的. s(…
先放知识点: 莫比乌斯反演 卢卡斯定理求组合数 乘法逆元 快速幂取模 GCD of Sequence Alice is playing a game with Bob. Alice shows N integers a 1, a 2, -, a N, and M, K. She says each integers 1 ≤ a i ≤ M. And now Alice wants to ask for each d = 1 to M, how many different sequences b…
Happy 2004 问题描述 : Consider a positive integer X,and let S be the sum of all positive integer divisors of 2004^X. Your job is to determine S modulo 29 (the rest of the division of S by 29). Take X = 1 for an example. The positive integer divisors of 2…
Happy 2004 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 2183    Accepted Submission(s): 1582 Problem Description Consider a positive integer X,and let S be the sum of all positive integer di…
因子和: 的因子是1,2,3,6; 6的因子和是 s(6)=1+2+3+6=12; 的因子是1,2,4,5,10,20; 20的因子和是 s(20)=1+2+4+5+10+20=42; 的因子是1,2; 2的因子和是 s(2)=1+2=3; 的因子是1,3; 3的因子和是 s(3)=1+3=4; 的因子和是 s(4)=1+2+4=7; 的因子和是 s(5)=1+5=6; s(6)=s(2)*s(3)=3*4=12; s(20)=s(4)*s(5)=7*6=42; 这是巧合吗? 再看 s(50)=…