Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ • π ƒ -¹ ² ³ °
You are not logged in.
Post a reply
Topic review (newest first)
That is the fastest for an exact answer concerning primality. If you use the probabilistic RM and run through the algorithm say 15
yeah. just testing if the number is prime
Depends what are you trying to do? Primality testing? What?
is there a better and faster method of testing?
I think the bottleneck is the testing itself. Oh well. No matter. I'll eventually figure this out.
yep, which is why i want to try to speed up the testing a bit
no. i guess my comment was a bit vague
p = randint(3, 2**L) p = q * (1 + p/q) + 1 while MillerRabin(p) == False: # prime = True, composite = False p = p + q
miller rabin is not what im creating. rather, it is another function that im using to test my p values, and it is the probabilistic test.
well the entire code block is just a pseudo code, but randint (which is also a legitimate command) is supposed to returns a random integer between a and b, inclusive. the real code is barely any different