mersenneforum.org > Math Largest 64 bit prime?
 User Name Remember Me? Password
 Register FAQ Search Today's Posts Mark Forums Read

 2004-12-26, 19:33 #1 amcfarlane     Nov 2004 UK 2·19 Posts Largest 64 bit prime? Can anyone tell me please what the largest prime number is that will fit into a 64-bit unsigned variable?
 2004-12-26, 21:06 #2 Xyzzy     "Mike" Aug 2002 757310 Posts Sounds like a homework problem! http://www.utm.edu/research/primes/l...mall/0bit.html
 2004-12-26, 21:12 #3 Xyzzy     "Mike" Aug 2002 1D9516 Posts Code: mv@k8:~$echo '2^64-59' | bc | factor 18446744073709551557: 18446744073709551557  2004-12-26, 21:20 #4 Xyzzy "Mike" Aug 2002 7,573 Posts 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
 2004-12-26, 21:26 #5 amcfarlane     Nov 2004 UK 2×19 Posts That's very clever ! -- Thanks...
 2004-12-26, 22:37 #6 marc     Jun 2004 UK 13910 Posts Might want to set your while loop to != 0 or even just something like while [ " " ] and there's the obvious += 2 time saver.
 2004-12-26, 23:15 #7 alpertron     Aug 2002 Buenos Aires, Argentina 23·3·5·11 Posts Just write b(2^64) in my factoring applet.

 Similar Threads Thread Thread Starter Forum Replies Last Post sudaprime Miscellaneous Math 11 2018-02-05 08:10 Unregistered Information & Answers 12 2013-05-31 08:18 dabaichi News 561 2013-03-29 16:55 Unregistered Information & Answers 24 2008-12-13 08:13 wfgarnett3 Lounge 7 2002-11-25 06:34

All times are UTC. The time now is 10:23.

Thu Aug 6 10:23:15 UTC 2020 up 20 days, 6:10, 1 user, load averages: 1.64, 1.84, 1.79