did i just break RSA?
up to 13 my function appears to be slightly faster than beer hunters modified algorithm, will some one with a large number library pls test these out?
Run a test on both functions with N up to 65535 for correctness and speed.
I would be afraid your verison will begin to choke(huge number processing overhead) on the size of the factorials rather quickly around(n=100-200).
So please post back with the results.
I would be afraid your verison will begin to choke(huge number processing overhead) on the size of the factorials rather quickly around(n=100-200).
So please post back with the results.
Well. You WOULD have broken RSA except for the fact you used a goto. And because of that, you fail.
while (temp>1)
{
temp--;
n = n * temp ;
}
return n;
Ben
[ IcarusIndie.com | recycledrussianbrides.com ]
while (temp>1)
{
temp--;
n = n * temp ;
}
return n;
Ben
[ IcarusIndie.com | recycledrussianbrides.com ]
well it would appear this is the fastest possible way to find prime numbers , if you can find a number library that will work with it.
The reason we bashed you is because you posted this:
(n-1)! +1 / n == 0
instead of this
(n-1)! +1 % n == 0
(n-1)! +1 / n == 0
instead of this
(n-1)! +1 % n == 0
quote:Original post by vanegerIt isn''t — it runs in exponential time. The fastest known deterministic-time algorithm is described here. It runs in polynomial time.
well it would appear this is the fastest possible way to find prime numbers , if you can find a number library that will work with it.
The GMP has a factorial operator! And you can test its speed on their site. Just some interesting stuff to play around with.
(65534!+1)%65535
(65534!+1)%65535
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement