mersenneforum.org  

Go Back   mersenneforum.org > New To GIMPS? Start Here! > Information & Answers

Reply
 
Thread Tools
Old 2012-08-29, 16:21   #34
cheesehead
 
cheesehead's Avatar
 
"Richard B. Woods"
Aug 2002
Wisconsin USA

769210 Posts
Default

Quote:
Originally Posted by LaurV View Post
Well, now if you would have so much space, why to store the "3^" and not to store the exponent only? I mean the product. The reason we need the "3^" and generally "b^" part is because the product is not reducible mod Mp (it is however reducible mod (f-1)(g-1) where f, g are the factors of Mp, which we don't know). So, if we have so much memory, we can store the product of all the powers to a high B1, and then take only a single exponentiation of 3 (or b) for each p, mod Mp and a single GCD at the end.
But your proposed "single exponentiation" will have to be performed via many modular multiplications, won't it? (AFAIK, one can't just do an FFT on the base and exponent to get exponentiation in one step.) And won't the total cost of those multiplications wind up being the same as in the way we now do it?
cheesehead is offline   Reply With Quote
Old 2012-08-29, 16:47   #35
LaurV
Romulan Interpreter
 
LaurV's Avatar
 
Jun 2011
Thailand

258A16 Posts
Default

Of course. I was talking only about storage. About the necessary time, well, it may be even more costly that you said, or it may be not. Because you need anyhow FFT for squaring and you will need a lot of squares at the end, for each bit in that large product. In the way as we are currently doing, primes can be paired to optimize the exponentiation, and taking the modulus each step reduces the number of squares too. If you compute and store the product before, there is no pairing and no optimization possible, but you only need to do exponentiation for each exponent p (no overload), so you may get away cheaper for a large set of p's. What do I mean, if you raise b at the power of 101 (7 bits number) mod 20 bits number, you do 6 squarings of 20 bits numbers. Then you raise the result at 103, another 6 squarings. If you multiply x=101*103=10403 and raise b^x, then this is 13 bits number, you still do 12 squares of a 20 bit number, can't get cheaper. Of course, you did an additional short multiplication for x, but if you have to test 100 p's, then you only did the overload once (like the trouble of finding that 103 is the interesting one after 101, for example, is part of the overload, and in the first case you have to do it 100 times).

Since I try to implement some p-1 algorithm I cooked this donut on all sides, and honestly I don't know which solution is the best.

Last fiddled with by LaurV on 2012-08-29 at 16:59
LaurV is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best Work for Finding Primes Unregistered Information & Answers 9 2012-06-24 13:50
New method of finding large prime numbers georgelouis@mac Math 41 2011-01-25 21:06
Finding the square root of a large mersenne number Fusion_power Math 29 2010-10-14 17:05
newbie question - finding small factors of very large numbers NeoGen Math 7 2007-03-13 00:04
Finding primes with a PowerPC rogue Lounge 4 2005-07-12 12:31

All times are UTC. The time now is 15:49.


Fri Jul 16 15:49:01 UTC 2021 up 49 days, 13:36, 1 user, load averages: 1.71, 1.89, 1.76

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.