View Single Post
Old 2020-10-22, 11:32   #10
retina
Undefined
 
retina's Avatar
 
"The unspeakable one"
Jun 2006
My evil lair

22×5×307 Posts
Default

Quote:
Originally Posted by ONeil View Post
As you can see I think this beats most if all factoring codes out there with some factoring coding techniques on some numbers.
Claim is false because I can make faster code:
Code:
import timeit
while True:
	p = int(input("Enter a prime number: "))
	start_time = timeit.default_timer()
	for k in range(1,999999999):
		if ((2**p-1) % (2*k*p+1)) == 0:
			print(2*k*p+1)
			print(timeit.default_timer() - start_time,'seconds')
			break
I guarantee my code is faster than yours for any number you input, except for the hardcoded known primes which I removed.
retina is online now