最大素数---Mersenne Prime --2^32582657-1

最近有幸听几个程序员瞎白话“能发现新的素数就能得到几百万美元的奖励,他们还打算回去自己编个循序程序去计算 ……”,我的第一个反应是long int内的素数一定已经用这个简单的算法找到了,2^32582657-1 这个是比较新的质数(素数),如何简化的存储一个整数估计就成了一个问题,或者能找出合理的寻找素数的新逻辑等等,关于质数有个简单的原理,“不能被现有质数整除的数就是新质数”有待证明,或者已经被证明!

迄今为止,人类发现的最大的素数是 2^32582657-1,这是第 46个 梅森(Mersenne)素数。

http://www.mersenne.org/various/freeware.htm

  素数也叫质数,是只能被自己和 1 整除的数,例如2、3、5、7、11等。2500 年前,希腊数学家欧几里德证明了素数是无限的,并提出少量素数可写成“2 的n次方减 1”的形式,这里 n 也是一个素数。此后许多数学家曾对这种素数进行研究,17 世纪的法国教士马丁·梅森(Martin Mersenne)是其中成果较为卓著的一位,因此后人将“2的n次方减1”形式的素数称为梅森素数。

  第19~41个梅森素数

  序号 素数 位数 发现人 时间

  41 224036583-1 7235733 John Findley 2004

  40 220996011-1 6320430 Michael Shafer 2003

  39 213466917-1 4053946 Michael Cameron 2001

  38 26972593-1 2098960 Nayan, Woltman, Kurowski 1999

  37 23021377-1 909526 Clarkson, Woltman, Kurowski 1998

  36 22976221-1 895932 Spence, Woltman 1997

  35 21398269-1 420921 Armengaud, Woltman 1996

  34 21257787-1 378632 Slowinski & Gage 1996

  33 2859433-1 258716 Slowinski & Gage 1994

  32 2756839-1 227832 Slowinski & Gage 1992

  31 2216091-1 65050 David Slowinski 1985

  30 2132049-1 39751 David Slowinski 1983

  29 2110503-1 33265 Welsh & Colquitt 1988

  28 286243-1 25962 David Slowinski 1982

  27 244497-1 13395 Slowinski & Nelson 1979

  26 223209-1 6987 L. Curt Noll 1979

  25 221701-1 6533 Nickel & Noll 1978

  24 219937-1 6002 Bryant Tuckerman 1971

  23 211213-1 3376 Donald B. Gillies 1963

  22 29941-1 2993 Donald B. Gillies 1963

  21 29689-1 2917 Donald B. Gillies 1963

  20 24423-1 1332 Alexander Hurwitz 1961

  19 24253-1 1281 Alexander Hurwitz 1961

  1995 年,美国程序设计师乔治·沃特曼整理有关梅森素数的资料,编制了一个梅森素数计算程序,并将其放置在因特网上供数学爱好者使用,这就是“因特 网梅森素数大搜索”计划。目前有6万多名志愿者、超过20万台计算机参与这项计划。该计划采取分布式计算方式,利用大量普通计算机的闲置时间,获得相当于 超级计算机的运算能力,第 37、38 和 39 个梅森素数都是用这种方法找到的。美国一家基金会还专门设立了 10 万美元的奖金,鼓励第一个找到超过千万位素数的人。

About Mersenne numbers

In computer science, unsigned n-bit integers can be used to express numbers up to Mn.

In the mathematical problem Tower of Hanoi, solving a puzzle with an n-disc tower requires at least Mn steps.

[edit] About Mersenne primes

Unsolved problems in mathematics: Are there infinitely many Mersenne primes?

Many fundamental questions about Mersenne primes remain unresolved. It is not even known whether the set of Mersenne primes is infinite. The Lenstra-Pomerance-Wagstaff conjecture asserts that, on the contrary, there are infinitely many Mersenne primes and predicts their order of growth. It is also not known whether infinitely many Mersenne numbers with prime exponents are composite, although this would follow from widely believed conjectures about prime numbers, for example, the infinitude of Sophie Germain primes.

A basic theorem about Mersenne numbers states that in order for Mn to be a Mersenne prime, the exponent n itself must be a prime number. This rules out primality for numbers such as M4 = 24−1 = 15: since the exponent 4=2×2 is composite, the theorem predicts that 15 is also composite; indeed, 15 = 3×5. The three smallest Mersenne primes are

M 2 = 3, M 3 = 7, M 5 = 31.

While it is true that only Mersenne numbers Mp, where p = 2, 3, 5, … could be prime, it may nevertheless turn out that Mp is not prime even for a prime exponent p. The smallest counterexample is the Mersenne number

M 11 = 2 11 − 1 = 2047 = 23 × 89,

which is not prime, even though 11 is a prime number. The lack of an obvious rule to determine whether a given Mersenne number is prime makes the search for Mersenne primes an interesting task, which becomes difficult very quickly, since Mersenne numbers grow very rapidly. The Lucas–Lehmer test for Mersenne numbers is an efficient primality test that greatly aids this task. Search for the largest known prime has somewhat of a cult following. Consequently, a lot of computer power has been expended searching for new Mersenne primes, much of which is now done using distributed computing.

Mersenne primes are used in pseudorandom number generators such as the Mersenne twister, Park–Miller random number generator, Generalized Shift Register and Fibonacci RNG.

[edit] Searching for Mersenne primes

The identity

shows that Mn can be prime only if n itself is prime—that is, the primality of n is necessary but not sufficient for Mn to be prime—which simplifies the search for Mersenne primes considerably. The converse statement, namely that Mn is necessarily prime if n is prime, is false. The smallest counterexample is 211 − 1 = 2,047 = 23×89, a composite number.

Fast algorithms for finding Mersenne primes are available, and the largest known prime numbers as of 2008 are Mersenne primes.

The first four Mersenne primes M2 = 3, M3 = 7, M5 = 31 and M7 = 127 were known in antiquity. The fifth, M13 = 8191, was discovered anonymously before 1461; the next two (M17 and M19) were found by Cataldi in 1588. After nearly two centuries, M31 was verified to be prime by Euler in 1772. The next (in historical, not numerical order) was M127, found by Lucas in 1876, then M61 by Pervushin in 1883. Two more (M89 and M107) were found early in the 20th century, by Powers in 1911 and 1914, respectively.

The best method presently known for testing the primality of Mersenne numbers is based on the computation of a recurring sequence, as developed originally by Lucas in 1856[2][3] and improved by Lehmer in the 1930s, now known as the Lucas-Lehmer test for Mersenne numbers. Specifically, it can be shown that (for n > 2) Mn = 2n − 1 is prime if and only if Mn divides Sn−2, where S0 = 4 and for k > 0, .

Graph of number of digits in largest known Mersenne prime by year - electronic era. Note that the vertical scale is logarithmic.

The search for Mersenne primes was revolutionized by the introduction of the electronic digital computer. The first successful identification of a Mersenne prime, M521, by this means was achieved at 10:00 P.M. on January 30, 1952 using the U.S. National Bureau of Standards Western Automatic Computer (SWAC) at the Institute for Numerical Analysis at the University of California, Los Angeles, under the direction of Lehmer, with a computer search program written and run by Prof. R.M. Robinson. It was the first Mersenne prime to be identified in thirty-eight years; the next one, M607, was found by the computer a little less than two hours later. Three more— M1279, M2203, M2281— were found by the same program in the next several months. M4253 is the first Mersenne prime that is titanic, M44497 is the first gigantic, and M6,972,593 was the first megaprime to be discovered, being a prime with at least 1,000,000 digits.[4] All three were the first known prime of any kind of that size.

In September 2008, mathematicians at UCLA participating in GIMPS appear to have won part of a $100,000 prize from the Electronic Frontier Foundation for their discovery of a very nearly 13-million-digit Mersenne prime. The prize is for the first known prime with at least 10 million digits. The prime was found on a Dell OptiPlex 745 on August 23. This is the eighth Mersenne prime discovered at UCLA.[5]

[edit] Theorems about Mersenne numbers

or

by setting c=2a, d=1, and n=b

proof

= anbn
  • 2) If 2n − 1 is prime, then n is prime.

proof

By

If n is not prime, or n = ab where 1 < a, b < n. Therefore, 2a − 1 would divide 2n − 1, or 2n − 1 is not prime.

  • 3) If p is an odd prime, then any prime q that divides 2p − 1 must be 1 plus a multiple of 2p. This holds even when 2p − 1 is prime. Example I: 25 − 1 = 31

is prime, and 31 is 1 plus a multiple of 2×5. Example II: 211 − 1 = 23×89', 23 = 1 + 2×11, and 89 = 1 + 8×11, and also 23×89 = 1 + 186×11.

proof

If q divides 2p − 1 then 2p ≡ 1 (mod q). By Fermat's Little Theorem, 2(q − 1) ≡ 1 (mod q). Assume p and q − 1 are relatively prime, a similar application of Fermat's Little Theorem says that (q − 1)(p − 1) ≡ 1 (mod p). Thus there is a number x ≡ (q − 1)(p − 2) for which (q − 1)·x ≡ 1 (mod p), and therefore a number k for which (q − 1)·x − 1 = kp. Since 2(q − 1) ≡ 1 (mod q), raising both sides of the congruence to the power x gives 2(q − 1)x ≡ 1, and since 2p ≡ 1 (mod q), raising both sides of the congruence to the power k gives 2kp ≡ 1. Thus 2(q − 1)x ÷ 2kp = 2(q − 1)x − kp ≡ 1 (mod q). But by definition, (q − 1)x − kp = 1, implying that 21 ≡ 1 (mod q); in other words, that q divides 1. Thus the initial assumption that p and q − 1 are relatively prime is untenable. Since p is prime q-1 must be a multiple of p.

  • 4) If p is an odd prime, then any prime q that divides 2p − 1 must be congruent to . Proof: 2p + 1 = 2(mod q), so 2(p + 1) / 2 is a square root of 2 modulo q. By quadratic reciprocity, any prime modulo which two has a square root is congruent to .

[edit] History

Mersenne primes were considered already by Euclid, who found a connection with the perfect numbers. They are named after 17th century French scholar Marin Mersenne, who compiled a list of Mersenne primes with exponents up to 257. His list was only partially correct, as Mersenne mistakenly included M67 and M257 (which are composite), and omitted M61, M89, and M107 (which are prime). Mersenne gave little indication how he came up with his list[6], and its rigorous verification was completed more than two centuries later.

[edit] List of known Mersenne primes

The table below lists all known Mersenne primes (sequence A000668 in OEIS):

#p MpDigits in MpDate of discoveryDiscoverer
12315th century BC[7] Ancient Greek mathematicians
23715th century BC[7]Ancient Greek mathematicians
353123rd century BC[7]Ancient Greek mathematicians
4712733rd century BC[7]Ancient Greek mathematicians
513819141456 anonymous [8]
61713107161588Cataldi
71952428761588Cataldi
8312147483647101772Euler
9612305843009213693951191883Pervushin
1089618970019…449562111271911Powers
11107162259276…010288127331914Powers[9]
12127170141183…884105727391876Lucas
13521686479766…115057151157January 30, 1952Robinson
14607531137992…031728127183January 30, 1952Robinson
151,279104079321…168729087386June 25, 1952Robinson
162,203147597991…697771007664October 7, 1952Robinson
172,281446087557…132836351687October 9, 1952Robinson
183,217259117086…909315071969September 8, 1957Riesel
194,253190797007…3504849911,281November 3, 1961Hurwitz
204,423285542542…6085806071,332November 3, 1961Hurwitz
219,689478220278…2257541112,917May 11, 1963Gillies
229,941346088282…7894635512,993May 16, 1963Gillies
2311,213281411201…6963921913,376June 2, 1963Gillies
2419,937431542479…9680414716,002March 4, 1971Tuckerman
2521,701448679166…5118827516,533October 30, 1978 Noll & Nickel
2623,209402874115…7792645116,987February 9, 1979Noll
2744,497854509824…01122867113,395April 8, 1979 Nelson & Slowinski
2886,243536927995…43343820725,962September 25, 1982Slowinski
29110,503521928313…46551500733,265January 28, 1988 Colquitt & Welsh
30132,049512740276…73006131139,751September 19, 1983[7]Slowinski
31216,091746093103…81552844765,050September 1, 1985[7]Slowinski
32756,839174135906…544677887227,832February 19, 1992Slowinski & Gage on Harwell Lab Cray-2[10]
33859,433129498125…500142591258,716January 4, 1994[11]Slowinski & Gage
341,257,787412245773…089366527378,632September 3, 1996Slowinski & Gage[12]
351,398,269814717564…451315711420,921November 13, 1996 GIMPS / Joel Armengaud[13]
362,976,221623340076…729201151895,932August 24, 1997GIMPS / Gordon Spence[14]
373,021,377127411683…024694271909,526January 27, 1998GIMPS / Roland Clarkson[15]
386,972,593437075744…9241937912,098,960June 1, 1999GIMPS / Nayan Hajratwala[16]
3913,466,917924947738…2562590714,053,946November 14, 2001GIMPS / Michael Cameron[17]
40[*] 20,996,011125976895…8556820476,320,430November 17, 2003GIMPS / Michael Shafer[18]
41[*] 24,036,583299410429…7339694077,235,733May 15, 2004GIMPS / Josh Findley[19]
42[*] 25,964,951122164630…5770772477,816,230February 18, 2005GIMPS / Martin Nowak[20]
43[*] 30,402,457315416475…6529438719,152,052December 15, 2005GIMPS / Curtis Cooper & Steven Boone[21]
44[*] 32,582,657124575026…0539678719,808,358September 4, 2006GIMPS / Curtis Cooper & Steven Boone[22]
45[*] 37,156,667202254406…30822092711,185,272September 6, 2008GIMPS / Hans-Michael Elvenich[23]
46[*] 43,112,609316470269…69715251112,978,189August 23, 2008GIMPS / Edson Smith[23]

*It is not known whether any undiscovered Mersenne primes exist between the 39th (M13,466,917) and the 46th (M43,112,609) on this chart; the ranking is therefore provisional. For a historical example, note that the 29th Mersenne prime was discovered after the 30th and the 31st. It is also remarkable that the current record holder was followed 14 days later by a smaller Mersenne prime.

To help visualize the size of the 46th known Mersenne prime, it would require 3,461 pages to display the number in base 10 with 75 digits per line and 50 lines per page. [7]

[edit] Factorization of Mersenne numbers

The factorization of a prime number is by definition the number itself. This section is about composite numbers. Mersenne numbers are very good test cases for the special number field sieve algorithm, so often the largest number factorized with this algorithm has been a Mersenne number. As of March 2007[update], 21039−1 is the record-holder,[24] after a calculation taking about a year on a couple of hundred computers, mostly at NTT in Japan and at EPFL in Switzerland. See integer factorization records for links to more information. The special number field sieve can factorize numbers with more than one large factor. If a number has only one very large factor then other algorithms can factorize larger numbers by first finding small factors and then making a primality test on the cofactor. As of 2008[update], the largest composite Mersenne number with proven prime factors is 217029−1 = 418879343 × p, where p was proven prime with ECPP.[25] The largest with probable prime factors allowed is 2173867−1 = 52536637502689 × q, where q is a probable prime.[26]

[edit] Perfect numbers

Mersenne primes are interesting to many for their connection to perfect numbers. In the 4th century BC, Euclid demonstrated that if Mn is a Mersenne prime then

2 n−1×(2 n−1) = M n( M n+1)/2

is an even perfect number. In the 18th century, Leonhard Euler proved that, conversely, all even perfect numbers have this form. It is unknown whether there are any odd perfect numbers.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值