![]() |
|
|
#45 |
|
"Dana Jacobsen"
Feb 2011
Bangkok, TH
22×227 Posts |
I get the idea that it can be useful to have a theorem even if it isn't computationally attractive. The arguments against can be either that it is easily seen from number theory or that it isn't computationally useful. I'm not making the first, but perhaps others are hinting at it?
On the small side, we don't have "some tabulated list of primes" that are used as known primes. The computation time required to make just all the tiny 64-bit primes is immense but feasible. The storage requirements are possible, though be prepared to spend over 100 million USD for the storage array. The time taken to say "known via BPSW test" is 1 millisecond for a 64-bit prime (I just timed it on my 2012 computer). Half that time for 32-bit primes. To give us a better idea of how your method improves as the size increases, let's take a scenario where we want to use your method to prove a number prime that is 20,000 digits. Primo can do these but they are awfully time consuming. Assume for the sake of argument that we have some already proven primes of 20001, 20002, 20003, ... digits. Based on factordb, assume we have 1 or 2 of each. Can you describe the steps? It looks like we take the factorial of the square root, so our first step is taking a factorial of a 10,000 digit number. Does this seem practical? |
|
|
|
|
|
#46 | ||
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
1000000100002 Posts |
Quote:
Still I think the concept is perhaps novel which was my motivation behind the post to see if indeed it was. I'm still interested to see a reference to this concept elsewhere. Quote:
False assumption I guess, but that was the rational behind the smallest consecutive known primes. But not having such a list doesn't really invalidates the scenario I proposed in my last post. Not really, hence the title of this thread. ![]() However, the impracticality is based on the inability to compute, store and operate on (very) large factorials. But for this particular application the factorials will have to be of the same order as the known large primes. If the primes don't need to be calculated to the last digit, then perhaps neither do the factorials. Think upper and lower significant digits required for establishing the constraints required and doing the subtraction (Computations involved, I know). Last fiddled with by a1call on 2016-03-11 at 02:24 |
||
|
|
|
|
|
#47 |
|
Jun 2003
117378 Posts |
Your loop is computing GCD. Might as well use built-in function.
What Sterling's theorem algo? Your program was merely doing trial division in a roundabout way. |
|
|
|
|
|
#48 | |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
24·3·43 Posts |
Quote:
http://mathworld.wolfram.com/Stirlin...oximation.html The reference was not to the GCD vs. the Mod loop. I learned about the GCD command for the first time from your post. Thank you. ![]() ETA but as pointed out by CRGreathouse smaller fsctorials are faster to operate on. The 2 factors will have to be weighed in. Last fiddled with by a1call on 2016-03-11 at 03:20 |
|
|
|
|
|
|
#49 |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
24·3·43 Posts |
Here is a 712707 decimal digits prime that is guaranteed to be prime using my suggested concept and proved by my infamous Theorem 1.
150209! - (119878*5^1019645-1) https://primes.utm.edu/primes/page.php?id=114317 WDP code: Code:
n=150209; p0=119878*5^1019645-1 ; p1=n !-p0; Print["p1<n^2 is ", p1<n^2 ] Print[IntegerLength[p1]] Published page for the code: https://www.wolframcloud.com/objects...1-a8e1e58be5b3 Last fiddled with by a1call on 2016-03-11 at 06:03 |
|
|
|
|
|
#50 | |
|
Jun 2003
5,087 Posts |
Quote:
There are more efficient algorithms for calculating a factorial than naively multiplying 1,2,3,..,n one after the other. However, a primorial can be done even faster, in all cases. You should time both factorial calculation and primorial calculation and compare which is faster (instead of guessing). Last fiddled with by axn on 2016-03-11 at 06:03 |
|
|
|
|
|
|
#51 | |
|
Romulan Interpreter
Jun 2011
Thailand
26×151 Posts |
Quote:
![]() With that n, and theorem 1, you can mostly prove that a number smaller than 22,562,743,681 is prime. Not larger. Last fiddled with by LaurV on 2016-03-11 at 06:19 |
|
|
|
|
|
|
#52 | |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
206410 Posts |
Quote:
false alarm I can't figure out why the code gives true for the condition though. Do you? |
|
|
|
|
|
|
#53 |
|
"Rashid Naimi"
Oct 2015
Remote to Here/There
24·3·43 Posts |
Negative value, forgot to put the absolute value function.
My apologies. |
|
|
|
|
|
#54 |
|
"Dana Jacobsen"
Feb 2011
Bangkok, TH
22·227 Posts |
Re factorial complexity, I recommend looking at the various implementations and data from Peter Luschny. It's a bit unorganized but there's a lot of info there. GMP uses his Swing method for mpz_fac_ui since version 5.1, No idea what WDP uses, but there are so many other variables that it probably doesn't matter.
Primorials can be sped up a lot (e.g. 10x or more) using product trees. GMP added this optimization in 5.2 to mpz_primorial_ui. I wrote my own simple version that just uses the standard mpz API. axn is definitely right that benchmarking is a good idea, especially as you're using unusual software (WDP). With GMP, primorials are faster (e.g. 4.4s vs. 40.2s for 10^8# vs. 10^8!). It's nice for testing the hypothesis that we think one *ought* to be faster than the other (and especially when we have opposite hypotheses as we do here). |
|
|
|
|
|
#55 | ||
|
Aug 2006
3×1,993 Posts |
Quote:
![]() Quote:
|
||
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How long will it be until MM61 is within practical reach of PRP/primality testing? | Stargate38 | Operazione Doppi Mersennes | 14 | 2020-01-29 20:35 |
| GQQ: a "deterministic" "primality" test in O(ln n)^2 | Chair Zhuang | Miscellaneous Math | 21 | 2018-03-26 22:33 |
| Modifying the Lucas Lehmer Primality Test into a fast test of nothing | Trilo | Miscellaneous Math | 25 | 2018-03-11 23:20 |
| a new Deterministic primality testing | wsc812 | Computer Science & Computational Number Theory | 36 | 2013-03-04 06:25 |
| maximum theoretical speed of LL test w/o bandwidth limitations? | ixfd64 | Hardware | 30 | 2012-03-05 06:16 |