mersenneforum.org > Math primility testing
 Register FAQ Search Today's Posts Mark Forums Read

 2004-01-26, 21:37 #12 Peleg_r   2×2,251 Posts Primality tests I understand you need some code to implement in a computer program. please specify the OS platform and programming language you preffer to work with and i'll see what i can do. From what i gather you need to test primes up to 20 digits, is this correct? Please reply here or at the user forum at www.shteker.com
 2004-01-26, 21:51 #13 andi314     Nov 2002 2×37 Posts I'm using win98 and c++ mostly i wirte my programs with the help of the MIRACL libary or the giantint library
 2004-01-27, 05:07 #14 dsouza123     Sep 2002 2·331 Posts Some basic background information on trial factoring. Only need to test to the square root of the number. For numbers expressed in base ten the square root will be at most one more than half the number of digits as the number your trying to factor. A 15 digit number would have 8 digits max for the square root. All primes except 2 and 3 are 6x +/- 1 with x = 1 ... so the factor mod 6 must be either 1 or 5 to be a potential prime. A 64 bit unsigned integer can hold a 20 digit number (18446744073709551615 max).
 2004-01-27, 14:35 #15 andi314     Nov 2002 7410 Posts but trial factoring a 20 -digit number take a while!!! I want to implement a primility test where i know theat the number is 100% prime!!!
2004-01-27, 17:21   #16
ewmayer
2ω=0

Sep 2002
República de California

2D6916 Posts

Quote:
 Originally Posted by andi314 so which other methods could i use to determine that a number is 100% prime???
For numbers having no special form, there are a number of algorithms you could try, e.g. APRCL (named after its inventors), ECPP, or the recent deterministic AKS algorithm. Do a Google search on any of these and you'll find background info and in most case freeware implementations. The practical limit of these seems to be 5000-10000 digits at present - proving any number < 100 digits or so would be virtually instantaneous via these methods.

 Similar Threads Thread Thread Starter Forum Replies Last Post kladner Soap Box 3 2016-10-14 18:43 pepi37 Software 6 2013-04-12 09:42 grobie Marin's Mersenne-aries 1 2006-05-15 12:26 eepiccolo Math 6 2006-03-28 20:53 ndpowell Math 4 2005-06-26 20:14

All times are UTC. The time now is 12:07.

Wed Apr 14 12:07:35 UTC 2021 up 6 days, 6:48, 0 users, load averages: 2.75, 2.40, 2.06