![]() |
|
|
#100 | |
|
Aug 2006
3·1,993 Posts |
Quote:
So your proposal is a waste of time, in that it saves 9 seconds at the cost of 126000000000000000000000000000000000000000000000000000000000000000000000000 years. Now you might object, realizing that almost all large powers are squares. That's a fair criticism: you could test for squares in less than a tenth the time. (And that test would catch an eight power!) In that case you're saving the same amount at the cost of only 10100000000000000000000000000000000000000000000000000000000000000000000000 years. But I could strike back, noting that the test to 10^9 is too much; replacing it with a test to 10^7 would cause an extra 10^87 * 0.0077 M-R tests (at 400 microseconds each) but save about 10^87 * 8 seconds. That's serious net savings for 'our' method against yours. Last fiddled with by CRGreathouse on 2010-07-18 at 18:18 |
|
|
|
|
|
|
#101 | |||
|
May 2010
Prime hunting commission.
168010 Posts |
Quote:
Hopefully this clears things up. Quote:
Quote:
Last fiddled with by 3.14159 on 2010-07-19 at 02:56 |
|||
|
|
|
|
|
#102 |
|
Nov 2008
1001000100102 Posts |
Imagine trying to find EVERY prime up to 10^100. You have to perform 10^100 nth power checks. Imagine you can do one every microsecond. Then the nth power tests will take 10^94 seconds. These tests save ~10^50 TF+MR runs.
Of course, for most numbers, only a teeny weeny bit of TF should be done. But let's imagine that we have to run your full TF and MR on every number. That will obviously take a lot longer than is necessary. If each TF+MR takes 10 seconds, then 10^50 of them will take 10^51 seconds. That is WAAAAAAY less than the nth power tests took, even though we ran TF to 10^9 and MR on every single number. In fact, even if each nth power test took just 1 Planck time, all the nth power tests would still take >10^55 seconds, which is STILL greater than the time taken to run TF to 10^9 plus one MR run (on a slow computer) on all the nth powers. |
|
|
|
|
|
#103 | |||||
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Quote:
Quote:
Quote:
2 * 1000000014000000048 = 2000000028000000096 seconds = 63376176515.3243 years at minimum, and at most 5000000070000000240 seconds, or 158440441288.3109 years. Quote:
Quote:
!Tell me: Which is faster: 10^101 seconds, or 10^94 seconds? ! X 2Even when I use the average figure of 2-5 seconds: 2 * 10^100 seconds vs. 10^94 seconds. By your own maths, the nth power check would make testing 10^7 times faster. Last fiddled with by 3.14159 on 2010-07-19 at 13:09 Reason: Moved to new post! |
|||||
|
|
|
|
|
#104 |
|
May 2010
Prime hunting commission.
24×3×5×7 Posts |
Alright: In case you object, I will extend that to 10^500:
Let's make the same assumptions you did. In fact: I will extend the time of the nth power check to 0.5 ms, for realistic figures. There are about 10^250 nth powers, saving 10^250 trial division and Miller-Rabin tests. Based on that, the nth power checks would take 5 * 10^496 seconds. The Miller-Rabin tests, combined with the initial trial division would take 5 * 10^250 seconds, for the numbers which it would test. If there were no check, it would take about 5 * 10^500 seconds to trial divide and perform the Miller-Rabin test on all 10^500 integers. 10^496 seconds vs. 10^500 seconds. In general, it would save 5 seconds for every nth power it caught. Between 1 and 10^500, it would save about 5 * 10^250 seconds. In a more realistic case, it would take 5 * 10^500 - (5 * 10^250) seconds, as opposed to 5 * 10^500 seconds. Last fiddled with by 3.14159 on 2010-07-19 at 13:10 |
|
|
|
|
|
#105 | |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
2×11×283 Posts |
Quote:
![]() That is like the old chestnut: The waiter keeps $2, + the $27 for the three customers, where is the extra dollar? Last fiddled with by retina on 2010-07-19 at 13:27 |
|
|
|
|
|
|
#106 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
"In a more realistic case, it would take 5 * 10^500 - (5 * 10^250) seconds, as opposed to 5 * 10^500 seconds." Also: Flinging feces is not recommended. Last fiddled with by 3.14159 on 2010-07-19 at 13:27 |
|
|
|
|
|
|
#107 | |
|
Undefined
"The unspeakable one"
Jun 2006
My evil lair
2×11×283 Posts |
Quote:
Try: "5 * 10^500 - (5 * 10^250) + 5 * 10^496 seconds, as opposed to 5 * 10^500 seconds." instead. |
|
|
|
|
|
|
#108 | |
|
May 2010
Prime hunting commission.
24·3·5·7 Posts |
Quote:
1 to 10^500.. 10^500 * 0.5 ms per check = 5 * 10^496 seconds total time. 10^250 nth powers save 5 * 10^250 seconds of trial division + Miller-Rabin testing. Runtime = 5 * 10^496 + (10^500 - 5 * 10^250) seconds, for the numbers that would undergo trial division and Miller-Rabin testing. Ohshi- You're right.
Last fiddled with by 3.14159 on 2010-07-19 at 13:49 |
|
|
|
|
|
|
#109 |
|
Aug 2006
3·1,993 Posts |
My point: You spend vastly more time weeding them out then if you simply let the M-R tests catch them, because your tests happen on non-powers as well. The wasted time is many orders of magnitude larger than the time saved (see my post for specific numbers) at any reasonable size.
|
|
|
|
|
|
#110 |
|
Aug 2006
3×1,993 Posts |
You're right that my improvement to your method is a strawman. My point was that, even using a technique that makes your method about ten times more efficient, it is still inefficient.
Last fiddled with by CRGreathouse on 2010-07-19 at 16:20 |
|
|
|
![]() |
| Thread Tools | |
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Wheel Factorization | a1call | Factoring | 11 | 2017-06-19 14:04 |
| Efficient Test | paulunderwood | Computer Science & Computational Number Theory | 5 | 2017-06-09 14:02 |
| LL tests more credit-efficient than P-1? | ixfd64 | Software | 3 | 2011-02-20 16:24 |
| A Wheel | storm5510 | Puzzles | 7 | 2010-06-25 10:29 |
| Most efficient way to LL | hj47 | Software | 11 | 2009-01-29 00:45 |