随笔分类 -  数论 --- 素数问题

poj 2773 Happy 2006
摘要:// 题意 :给你两个数 m(10^6),k(10^8) 求第k个和m互质的数是什么这题主要需要知道这样的结论gcd(x,n)=1 gcd(x+n,n)=1证明 假设 gcd(x,n)=1 gcd(x+n,n)!=1 令 a=n+x b=n 设 gcd(a,b)=k>1 那么有 a=Ak b=Bk x+Bk=Ak => x=(A-B)k k是n的因子 那么 x=(A-B)k 显然不成立 因为x不可能含有因子k(因为x,n互质); 所以假设不成立 那么这题剩下的就算求 比m小 与m互质的数就可以了#include #include #include #i... 阅读全文

posted @ 2013-07-25 11:01 江财小子 阅读(198) 评论(0) 推荐(0)

HDU 3501 Calculation 2
摘要:Calculation 2Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1296Accepted Submission(s): 544Problem DescriptionGiven a positive integer N, your task is to calculate the sum of the positive integers less than N which are not coprime to N. A is said 阅读全文

posted @ 2012-10-20 16:22 江财小子 阅读(277) 评论(0) 推荐(0)

hdu 4320 Arcane Numbers 1
摘要:Arcane Numbers 1Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1468Accepted Submission(s): 466Problem DescriptionVance and Shackler like playing games. One day, they are playing a game called "arcane numbers". The game is pretty simple, 阅读全文

posted @ 2012-08-03 15:34 江财小子 阅读(325) 评论(0) 推荐(0)

最大因子数(铭记)
摘要:最大因子数Time Limit : 10000/5000ms (Java/Other)Memory Limit : 65535/65535K (Java/Other)Total Submission(s) : 35Accepted Submission(s) : 16Font: Times New Roman | Verdana | GeorgiaFont Size: ← →Problem Description 定义f(n)为整数n的因子数,如f(9) = 3(分别是1,3,9).定义g(n)=k,整数k是满足f(k) = max{f(i)|0#include #include #inclu 阅读全文

posted @ 2012-07-24 10:06 江财小子 阅读(399) 评论(0) 推荐(0)

七夕节(求好多数因子的好方法)
摘要:七夕节Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18102Accepted Submission(s): 5396Problem Description七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!"人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下:数字N的因子就是所有比N小又能被N整除的所有正整数,如12的因子有1,2 阅读全文

posted @ 2012-07-24 09:34 江财小子 阅读(139) 评论(0) 推荐(0)

POJ 1142 Smith Numbers
摘要:Smith NumbersTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 10002Accepted: 3512DescriptionWhile skimming his phone directory in 1982, Albert Wilansky, a mathematician of Lehigh University,noticed that the telephone number of his brother-in-law H. Smith had the following peculiar property: 阅读全文

posted @ 2012-07-21 17:03 江财小子 阅读(378) 评论(0) 推荐(0)

POJ 2739 Sum of Consecutive Prime Numbers
摘要:Sum of Consecutive Prime NumbersTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 13616Accepted: 7590DescriptionSome positive integers can be represented by a sum of one or more consecutive prime numbers. How many such representations does a given positive integer have? For example, the integ 阅读全文

posted @ 2012-07-15 18:05 江财小子 阅读(1072) 评论(0) 推荐(0)

POJ 1595 Prime Cuts
摘要:Prime CutsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 8245Accepted: 3151DescriptionA prime number is a counting number (1, 2, 3, ...) that is evenly divisible only by 1 and itself. In this problem you are to write a program that will cut some number of prime numbers from the list of pri 阅读全文

posted @ 2012-07-05 23:40 江财小子 阅读(391) 评论(0) 推荐(0)

3518 Prime Gap
摘要:Prime GapTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 6597Accepted: 3775DescriptionThe sequence of n − 1 consecutive composite numbers (positive integers that are not prime and not equal to 1) lying between two successive prime numbers p and p + n is called a prime gap of length n. For e 阅读全文

posted @ 2012-07-05 23:36 江财小子 阅读(329) 评论(0) 推荐(0)