mersenneforum.org How to generate base10 representation of Mersenne-prime perfect numbers?
 Register FAQ Search Today's Posts Mark Forums Read

 2012-03-03, 02:43 #1 James Heinrich     "James Heinrich" May 2004 ex-Northern Ontario 23·5·83 Posts How to generate base10 representation of Mersenne-prime perfect numbers? I found this site which has base10 representations of Mersenne-prime perfect numbers, but it's lacking the ones for M45-M47. How can I generate these? Something that runs on Windows would be great, but if I do it with PARI I also have access to that on *nix.
 2012-03-03, 02:56 #2 Batalov     "Serge" Mar 2008 Phi(4,2^7658614+1)/2 100100101011002 Posts Pari Code: allocatemem(800000000) P=37156667; write("perf45",2^(P-1)*(2^P-1)) P=42643801; write("perf46",2^(P-1)*(2^P-1)) P=43112609; write("perf47",2^(P-1)*(2^P-1)) # in *nix fold < perf47 > perf47.txt
 2012-03-03, 08:58 #3 kar_bon     Mar 2006 Germany 43·67 Posts With pfgw: Code: pfgw -od -q"2^43112608*(2^43112609-1)" >M47.txt
2012-03-03, 13:17   #4
James Heinrich

"James Heinrich"
May 2004
ex-Northern Ontario

23×5×83 Posts

Quote:
 Originally Posted by kar_bon With pfgw: Code: pfgw -od -q"2^43112608*(2^43112609-1)" >M47.txt
Perfect, thanks! Worked nicely.

I tried PARI, and failed. On *nix, all I could get was a Segmentation Fault. On Windows, it ran for 15 minutes and didn't seem to be doing anything so I aborted (by contrast, pfgw only took about 45 seconds).

Last fiddled with by James Heinrich on 2012-03-03 at 13:18

2012-03-03, 13:28   #5
science_man_88

"Forget I exist"
Jul 2009
Dumbassville

26×131 Posts

Quote:
 Originally Posted by James Heinrich Perfect, thanks! Worked nicely. I tried PARI, and failed. On *nix, all I could get was a Segmentation Fault. On Windows, it ran for 15 minutes and didn't seem to be doing anything so I aborted (by contrast, pfgw only took about 45 seconds).
I got a working script:

Code:
(09:26)>MeVec
%240 = [2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917]
(09:26)>for(x=1,#MeVec, print((2^(MeVec[x]-1))*(2^MeVec[x]-1)))
just change MeVec to include the exponents you want.

 2012-03-03, 20:11 #6 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40
 2012-03-08, 00:20 #7 Xitami   Apr 2010 2×7 Posts
2012-03-08, 02:42   #8
LaurV
Romulan Interpreter

Jun 2011
Thailand

222318 Posts

Quote:
 Originally Posted by Xitami http://bellard.org/mersenne.html
I love it! So, you are one of the IOCCC winners? Respect!

 2012-03-08, 06:45 #9 Xitami   Apr 2010 2×7 Posts NO
2012-03-08, 07:05   #10
LaurV
Romulan Interpreter

Jun 2011
Thailand

33·347 Posts

Quote:
 Originally Posted by Xitami NO
Oh. Sorry. I don't know why I understood that is your web page the one you linked, maybe because of the first person speech there. Mea culpa. Anyhow, welcome to the forum.

 2012-03-08, 07:20 #11 Dubslow Basketry That Evening!     "Bunslow the Bold" Jun 2011 40

 Similar Threads Thread Thread Starter Forum Replies Last Post Housemouse Math 34 2016-04-07 16:29 Evgeny Dolgov Miscellaneous Math 38 2010-09-05 17:45 ET_ Miscellaneous Math 40 2010-06-06 12:55 Evgeny Dolgov Math 1 2003-12-08 09:25 dsouza123 Miscellaneous Math 33 2003-09-02 16:18

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

Mon Apr 12 16:50:25 UTC 2021 up 4 days, 11:31, 1 user, load averages: 1.42, 1.98, 2.06