mersenneforum.org Sorry about last post I hope u like this new factor method
 Register FAQ Search Today's Posts Mark Forums Read

 2020-12-30, 08:19 #1 ONeil   Dec 2017 24·3·5 Posts Sorry about last post I hope u like this new factor method I have found that ratios of numbers are related to factors of numbers in the form of 2^n-1. Go here: https://goodcalculators.com/ratio-calculator/ Now put in 1:37 and check number 6 its 222 add 1 and you get the factor for 2^37-1. So I built my factoring code in python around that premise, based on ratios. It can process 2^67-1 in 9 seconds. 2^101-1 is still slow, because its a big factor. HAPPY NEW YEAR, My Apologies everyone for all the crap you have had to deal with from me if I pissed you off in 2020. I hope to be better in 2021. Code: from decimal import * from math import floor, sqrt import time while True: def isqrt(n): x = n y = (x + 1) // 2 while y < x: x = y y = (x + n // x) // 2 return x n = (floor(n)) start_time = time.time() b = int(input(' Enter a number: ')) s = (pow(2,b-1)*2-1) n = (((isqrt(s)))) for x in range(1,n): if (pow(2,b-1)*2-1)%(b*x+1) ==0: print(b*x+1,'This is the factor of a number 2^number-1') e = int(time.time() - start_time) print('{:02d}:{:02d}:{:02d}'.format(e // 3600, (e % 3600 // 60), e % 60)) break
 2020-12-30, 08:51 #2 retina Undefined     "The unspeakable one" Jun 2006 My evil lair 6,143 Posts No need for such complication. I guarantee this is faster: Code: p = 67 k, n = 1, 1 << p while k * k < n: k += p + p if pow(2, p, k) == 1: print(k) break
2021-01-02, 16:46   #3
LaurV
Romulan Interpreter

Jun 2011
Thailand

22·17·139 Posts

Quote:
 Originally Posted by ONeil HAPPY NEW YEAR, My Apologies everyone for all the crap you have had to deal with from me if I pissed you off in 2020. I hope to be better in 2021.
Better crap? What we hope is not to be better, but to disappear.

2021-01-02, 17:02   #4
Uncwilly
6809 > 6502

"""""""""""""""""""
Aug 2003
101×103 Posts

7·372 Posts

Quote:
 Originally Posted by LaurV Better crap? What we hope is not to be better, but to disappear.
Here is a tip/challenge/request to the OP.

Don't post anything more until your very slow LL test completes.

Spend the time on seeing why the current factoring methods are better than anything you come up with. Python might be a fun language to play with, but if you are worried about how to factor quickly, you will need to learn a language that is closer to the metal and compiles. If you want to find factors for Mersenne numbers, look at all the work that has been done to exclude candidate factors. And look at the ways that previous tests have used smart programming to speed up tests. Then look at how programs like Prime95 exploit advanced CPU instructions to further speed things up.

2021-01-02, 20:01   #5
Dr Sardonicus

Feb 2017
Nowhere

2·2,273 Posts

Quote:
 Originally Posted by Uncwilly Here is a tip/challenge/request to the OP. Don't post anything more until your very slow LL test completes.
I can relate.

 Similar Threads Thread Thread Starter Forum Replies Last Post tServo GPU Computing 15 2018-03-08 22:20 ET_ Linux 14 2016-11-01 15:46 ewmayer Science & Technology 62 2007-11-11 04:05 ET_ Math 36 2005-11-10 22:15 hyh1048576 Factoring 11 2003-12-01 07:37

All times are UTC. The time now is 16:21.

Sun May 16 16:21:42 UTC 2021 up 38 days, 11:02, 1 user, load averages: 4.77, 3.44, 2.66