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,…
As we all know, the next Olympic Games will be held in Beijing in 2008. So the year 2008 seems a little special somehow. You are looking forward to it, too, aren't you? Unfortunately there still are months to go. Take it easy. Luckily you meet me. I…
Your job is simple, for each task, you should output Fn module 109+7. Input The first line has only one integer T, indicates the number of tasks. Then, for the next T lines, each line consists of 6 integers, A , B, C, D, P, n. 1≤T≤200≤A,B,C,D≤1091≤P,…
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…
题目链接 题意 : 给你一个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(…
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)=…
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…
2749: [HAOI2012]外星人 Description Input Output 输出test行,每行一个整数,表示答案. Sample Input 1 2 2 2 3 1 Sample Output 3 HINT Test<=50 Pi<=10^5,1<=Q1<=10^9 Source [分析] 额,一开始还看不懂题目..phi的x表示phi的x阶函数,即phi[phi[phi[...phi[N]]]]],x个phi... 然后不会做... 我们先来熟悉一下欧拉函数 2-…
Problem Description 七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下: 数字N的因子就是所有比N小又能被N整除的所有正整数,如12的因子有1,2,3,4,6. 你想知道你的另一半吗? Input 输入数据的第一行是一个数字T(1<=T<=500000),它表明测试数据的组数.然后是T组测试数据,每组测试数据…