mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Math

Reply
 
Thread Tools
Old 2004-12-26, 19:33   #1
amcfarlane
 
amcfarlane's Avatar
 
Nov 2004
UK

3810 Posts
Default Largest 64 bit prime?

Can anyone tell me please what the largest prime number is that will fit into a 64-bit unsigned variable?
amcfarlane is offline   Reply With Quote
Old 2004-12-26, 21:06   #2
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

21EF16 Posts
Default

Sounds like a homework problem!

http://www.utm.edu/research/primes/l...mall/0bit.html

Xyzzy is offline   Reply With Quote
Old 2004-12-26, 21:12   #3
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

7·17·73 Posts
Default

Code:
mv@k8:~$ echo '2^64-59' | bc | factor
18446744073709551557: 18446744073709551557
Xyzzy is offline   Reply With Quote
Old 2004-12-26, 21:20   #4
Xyzzy
 
Xyzzy's Avatar
 
Aug 2002

7×17×73 Posts
Default

Had I not cheated with that link, I would have done this:

Code:
#!/bin/sh
counter=1
while [ $counter != 1 ]
do
        echo '2^64-'$counter | bc | factor
(( counter += 1 ))
done
Xyzzy is offline   Reply With Quote
Old 2004-12-26, 21:26   #5
amcfarlane
 
amcfarlane's Avatar
 
Nov 2004
UK

1001102 Posts
Default

That's very clever ! -- Thanks...
amcfarlane is offline   Reply With Quote
Old 2004-12-26, 22:37   #6
marc
 
marc's Avatar
 
Jun 2004
UK

139 Posts
Default

Might want to set your while loop to != 0 or even just something like while [ " " ] and there's the obvious += 2 time saver.
marc is offline   Reply With Quote
Old 2004-12-26, 23:15   #7
alpertron
 
alpertron's Avatar
 
Aug 2002
Buenos Aires, Argentina

3×7×73 Posts
Default

Just write b(2^64) in my factoring applet.
alpertron is offline   Reply With Quote
Reply

Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
(M48) NEW MERSENNE PRIME! LARGEST PRIME NUMBER DISCOVERED! dabaichi News 571 2020-10-26 11:02
Largest nonmersenne prime Unregistered Information & Answers 38 2020-09-07 12:45
probable largest prime. sudaprime Miscellaneous Math 11 2018-02-05 08:10
Largest known prime Unregistered Information & Answers 24 2008-12-13 08:13
need Pentium 4s for 5th largest prime search (largest proth) wfgarnett3 Lounge 7 2002-11-25 06:34

All times are UTC. The time now is 21:27.


Thu Sep 28 21:27:05 UTC 2023 up 15 days, 19:09, 0 users, load averages: 0.59, 0.84, 0.90

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.

≠ ± ∓ ÷ × · − √ ‰ ⊗ ⊕ ⊖ ⊘ ⊙ ≤ ≥ ≦ ≧ ≨ ≩ ≺ ≻ ≼ ≽ ⊏ ⊐ ⊑ ⊒ ² ³ °
∠ ∟ ° ≅ ~ ‖ ⟂ ⫛
≡ ≜ ≈ ∝ ∞ ≪ ≫ ⌊⌋ ⌈⌉ ∘ ∏ ∐ ∑ ∧ ∨ ∩ ∪ ⨀ ⊕ ⊗ 𝖕 𝖖 𝖗 ⊲ ⊳
∅ ∖ ∁ ↦ ↣ ∩ ∪ ⊆ ⊂ ⊄ ⊊ ⊇ ⊃ ⊅ ⊋ ⊖ ∈ ∉ ∋ ∌ ℕ ℤ ℚ ℝ ℂ ℵ ℶ ℷ ℸ 𝓟
¬ ∨ ∧ ⊕ → ← ⇒ ⇐ ⇔ ∀ ∃ ∄ ∴ ∵ ⊤ ⊥ ⊢ ⊨ ⫤ ⊣ … ⋯ ⋮ ⋰ ⋱
∫ ∬ ∭ ∮ ∯ ∰ ∇ ∆ δ ∂ ℱ ℒ ℓ
𝛢𝛼 𝛣𝛽 𝛤𝛾 𝛥𝛿 𝛦𝜀𝜖 𝛧𝜁 𝛨𝜂 𝛩𝜃𝜗 𝛪𝜄 𝛫𝜅 𝛬𝜆 𝛭𝜇 𝛮𝜈 𝛯𝜉 𝛰𝜊 𝛱𝜋 𝛲𝜌 𝛴𝜎𝜍 𝛵𝜏 𝛶𝜐 𝛷𝜙𝜑 𝛸𝜒 𝛹𝜓 𝛺𝜔