View Single Post
Old 2020-10-22, 08:31   #7
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3·52·72 Posts
Default

Quote:
Originally Posted by ONeil View Post
LOok:

here is:

Enter a prime number: 2^1741-1

123943127595827984958197853301549195184477
951834649657232740658002980565512365360620
750598993511752753104781984819812404805160
890680671892376416742365754415406079582806
461586400276749177364829017737044195679413
446889774379589504010560948137281790718665
410595066884189580638081516368262928596510
612673202568108065230108178215006522436790
409863754899181812033711098574995216116141
064253029870990368664577321247037027510999
375505505057966517508215106597988717628821
189242173762409427175322603725836942582902
938380429071380119551

Now at Alpertron

Try factoring this 2^1741-1 at Alpertron and it will take a
long time its been 7 minutes and my program did it under 2 seconds.
Your code sux. Why not input the exponent? Why a huge if then else construct -- doesn't python have set inclusion? At least loop over an array. You do not use the structure of Mersennes with prime exponents, namely 2*k*p+1 -- loop over k instead and watch your ego smoke. You program does not completely factorise M1741 -- it finds a small factor of it. You'll also need to check the exponent entered is prime.

Last fiddled with by paulunderwood on 2020-10-22 at 08:50
paulunderwood is offline