Thank you ,"PARI/GP is fully open source and has no restrictions.". It is amazing that , the decimal digits extraction of perfect number#52 ,took less than 90 seconds using the following "pn52.gp" fileFor some things Mathematica is nice, for others it is too restricted.
PARI/GP is fully open source and has no restrictions.
Here are the 52 Mersenne prime exponents:
https://gist.github.com/Hermann-SW/f44c ... c2fd010e21
With them you can easily compute all 52 associated perfect numbers.
#digits() for number of decimal digits is very slow.
I used #binary() to output the binary length of the 52 perfect numbers.
Took 21 seconds in total on Pi5 — I had to increase parisizemax in /etc/gprc from 2200M to 3000M:....pi@raspberrypi5:~ $ gp -q mpe.gp
? c=1;foreach(mpe,t,print(c,": ",#binary(2^(t-1)*(2^t-1)));c+=1)
P.S:
If you want to print the numbers, shorter and faster is as hexadecimal numbers:PARI/GPCode:
printf("%#x",2^(t-1)*(2^t-1)));
is 13x faster thanCode:
x=17million_hex_digit_number;
https://gist.github.com/Hermann-SW/1aa0 ... nt-5286782Code:
x=20million_decimal_digit_number;
Code:
\\ Compute the 52th perfect numberp =136279841 ; \\ Exponent of the 52nd Mersenne primeperfect_number = 2^(p-1) * (2^p - 1);\\ Write the perfect number's digits to a filewrite("perfect_number_52.txt", Str(perfect_number));
Statistics: Posted by geev03 — Mon Nov 18, 2024 6:33 pm