![]() |
|
|
#12 |
|
Feb 2013
1CA16 Posts |
Continue right here?
I happen to know that the ecm and factor commands is about factorization. But you may find the isprime command being included in Yafu as well. Is this command also based on the factorization algorithm, or is it rather based on LLR? Software like WinPFGW is doing the similar thing by means of the LLR algorithm, which by some people may be regarded as an "approximation" to a given problem. The question becomes then. Is it all about the number being processsed (including its possible size) and also what kind of computer that is being used? Also the question about which kinds of software (including version numbers) that are being used for a given task. Is it more likely that a PRP5463 or PRP11943 is more likely to be accepted as being such a number using either Yafu or WinPFGW? Of course you should not able to factorize a 351,639 digit number like (2^1168183-1)/54763676838381762583. http://donovanjohnson.com/mersenne.html It took me 5 minutes to locate this number despite not having it here locally. You do not need a paper-based map or dictionary anymore. You are able to find almost everything you want with your PC alone. I am also having a look at similar numbers like 7333*2^138560+1 (both with -1 and +1) that are roughly the same size. According to http://www.factordb.com there are other numbers still listed as "U" being of similar size as this number. So the conclusion may be that this is still an open question lacking a finite answer. Last fiddled with by storflyt32 on 2014-10-20 at 16:01 |
|
|
|
|
|
#13 |
|
"Ben"
Feb 2007
3×1,171 Posts |
You really should not be using yafu for primality or even prp checks of numbers this large.
However there is something interesting here: Code:
int r;
mpz_t a;
mpz_init(a);
mpz_set_ui(a, 1);
mpz_mul_2exp(a, a, 138560);
mpz_mul_ui(a, a, 7333);
mpz_add_ui(a, a, 1);
printf("testing ...%lu\n", mpz_tdiv_ui(a, 1000000000));
r = mpz_probab_prime_p(a, 1);
printf("result is %d\n", r);
Code:
testing ...112555009 result is 0 Code:
testing ...112555009 result is 1 |
|
|
|
|
|
#14 |
|
Feb 2013
2·229 Posts |
Good post there, Batalov!
|
|
|
|
|
|
#15 |
|
"Ben"
Feb 2007
3×1,171 Posts |
Ok, after more checking I guess it's just yafu's use of gmp-5.1.1 that is messed up somehow. After remaking gmp-5.1.1 everything worked fine (result returned PRP).
|
|
|
|
|
|
#16 |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
36×13 Posts |
Ah. I was just about to ask if it fails for smaller inputs... Works fine here with 6.0.0.a ...
Code:
#include <stdio.h>
#include <gmp.h>
main()
{
int r;
int i, n[5] = {5774, 7932, 21704, 24976, 138560};
mpz_t a;
mpz_init(a);
for(i=0;i<5;i++) {
mpz_set_ui(a, 1);
mpz_mul_2exp(a, a, n[i]);
mpz_mul_ui(a, a, 7333);
mpz_add_ui(a, a, 1);
printf("testing 7333*2^%d+1 [...%lu]\n", n[i], mpz_tdiv_ui(a, 1000000000));
r = mpz_probab_prime_p(a, 1);
printf("result is %d\n", r);
}
}
|
|
|
|
|
|
#17 |
|
Einyen
Dec 2003
Denmark
1100010101112 Posts |
With he mpz_probab_prime_p function you need a much bigger number than 1 as the second parameter for a big number like: 7333*2138560+1.
Code:
int mpz_probab_prime_p (const mpz t n, int reps) [Function] Determine whether n is prime. Return 2 if n is definitely prime, return 1 if n is probably prime (without being certain), or return 0 if n is definitely composite. This function does some trial divisions, then some Miller-Rabin probabilistic primality tests. The argument reps controls how many such tests are done; a higher value will reduce the chances of a composite being returned as “probably prime”. 25 is a reasonable number; a composite number will then be identified as a prime with a probability of less than 2−50 . Miller-Rabin and similar tests can be more properly called compositeness tests. Numbers which fail are known to be composite but those which pass might be prime or might be composite. Only a few composites pass, hence those which pass are considered probably prime. http://www.trnicely.net/misc/mpzspsp.html Last fiddled with by ATH on 2014-10-20 at 20:07 |
|
|
|
|
|
#18 | |
|
Bamboozled!
"𒉺𒌌𒇷𒆷𒀭"
May 2003
Down not across
29·3·7 Posts |
Quote:
To see why, read up on the likelihood of the M-R test being mistaken for randomly chosen bases and randomly chosen numbers to test. If you chose the test number with malicious aforethought then, indeed, 25 tests may be appropriate. Such numbers are vanishingly rare. Paul |
|
|
|
|
|
|
#19 |
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
36·13 Posts |
This function (let's say called with 25 trials), of course, depending on the changing implementation can return a different (internal) chain of 1s, and then finally a 0 (which it will return) -- but only for a composite input. What it cannot do is return a 0 for a prime input. (which is what B.B. properly flagged as a bug. Then, it turn, even if the function is coded correctly, there are ways to miscompile, and that is what appears to be what he later diagnosed.)
For this input, one would expect an infinite row of "1"s returned (probable prime); the reason why Ben coded (...,1) was that it is quite slow for even a single M.-R. test. (~15 minutes on a fast core; pfgw takes 15 s, because it plain GMP uses a general version of multiplication and pfgw, a special fast one) |
|
|
|
|
|
#20 |
|
Feb 2013
2×229 Posts |
Please see this thread.
http://mersenneforum.org/showthread.php?t=14249 If you do not mind, often a smaller number may be harder to factorize than a larger number. The reason for this is that the factors are more equal in size to each other. Knowing that a P8 like 36085879 is a factor of 2^333-1 is no problem, but factorizing a composite number like 293155093804870332610909957481872064551757337569254797370666783 is a little bit harder to do. Please have me excused, but those numbers ending with -1 in the syntax definitely are a little more easy to be dealing with. The biggest prime number that is currently known is a Mersenne prime. Compare with the similar or corresponding Fermat search. Right now, the largest known Fermat prime is 475856^524288+1 which is a quite bit smaller number than Mersenne48 (or M48). So, before I started to get a hand on this stuff, I was wondering why such a prime number like the one mentioned above is that little bit larger than the largest known fermat "factor". http://factordb.com/index.php?query=2%5E2048%2B1 The P564 at the right in that listing. What is the possible relationship between these two numbers? Is it possible to assume that a number containing some 2,976,633 digits itself might be a factor of some other even larger number (which then becomes a composite one)? No reason to doubt why doing this kind of stuff is supposed to be a little hard to do at times. Because you are unable to factorize such a number (like the remainder of 2^4096+1 or 2^8192+1), you do not know what the factors are. The question becomes - is it possible to relate a specific number (factor) to a particular set of prime types? Looking at it, I get the feeling that there may be a correspondence or relationship between a Genefer number and a rep-digit number. Your opinion on this, please. Thanks! |
|
|
|
|
|
#21 | |
|
Sep 2002
Database er0rr
373910 Posts |
Quote:
Code:
? factor(293155093804870332610909957481872064551757337569254797370666783) [6951431036147505831119048893 1] [42171905652298228542447931081982731 1] |
|
|
|
|
|
|
#22 | ||
|
"Serge"
Mar 2008
Phi(4,2^7658614+1)/2
36·13 Posts |
Quote:
It will become clear why most known giant primes are either ...-1 or ...+1. Quote:
Read, the read some more, and you questions will be answered. Don't expect someone to stand by and be ready to answer your (so far, pretty basic) questions. "Give a man a fish... Teach a man to fish..." that sort of thing. |
||
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Composite being Prime | kruoli | FactorDB | 5 | 2018-02-16 16:54 |
| How can I prove this PRP prime? | siegert81 | Math | 2 | 2014-11-19 10:24 |
| How do I prove a 4000 digit number is prime?? | VJS | Lounge | 4 | 2005-05-09 20:56 |
| How do you prove a number is prime? | Alien | Math | 12 | 2004-01-07 11:36 |
| why not stop when composite is prove? | mdjvz | Software | 4 | 2003-09-28 17:13 |