| web23 . web138 on Sat, 07 Mar 2026 17:44:59 +0100 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| Unidentified subject! |
Sorry, problems with my webmailer, sending this with mail command from my hosted server.
On 2026-03-07 16:00, Karim Belabas wrote:
> * hermann@stamm-wilbrandt.de [2026-03-07 14:48]:
> [...]
>> So I cannot read it on my fast AMD 7950X PC with 32GB RAM. Anyway
>> phantastic!
>>
>> ? b=read("carm10e24.bin");
> [...]
>
> A trick (which may or may not help here) to reduce memory use by a
> factor 2 or so. The above saves the result twice in memory: in b as
> explicitly intended ... and in gp's history.
>
> ? b=read("carm10e24.bin"); 0 \\ for instance
>
> only saves 0 in history, not the full b.
>
> Cheers,
>
> K.B.
>
https://stamm-wilbrandt.de/cgi-bin/echo-e.to.braille.pl?i=Thanks+-+you+saved+my+day%21
$ echo -e 'Thanks - you saved my day!' | pbmtext -builtin fixed | pnmcrop | pbmtobraille
⡖⢲⠒⡎⡇⣀⠀⢀⣀⡀⢀⢀⣀⠀⢹⠀⣀⠀⢀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣀⢀⣀⠀⣀⡀⢀⡀⢀⡀⠀⠀⠀⠀⢀⣀⠀⢀⣀⡀⢀⣀⢀⣀⠀⣀⡀⠀⢀⣈⡇⠀⠀⠀⢀⣀⢀⠀⣀⡀⣀⡀⠀⠀⠀⠀⣀⣹⠀⣀⣀⠀⣀⡀⣀⡀⠀⡇
⠀⢸⠀⠀⡏⠀⡇⢠⠒⢺⠀⡏⠀⡇⢸⠪⡀⠀⡑⠒⡅⠀⠀⠀⠀⠒⠒⠂⠀⠀⠀⠀⢣⣠⠃⢸⠀⢸⠀⡇⠀⡇⠀⠀⠀⠀⡑⠒⡅⢠⠒⢺⠀⢣⣠⠃⢸⠒⢚⠀⡇⠀⡇⠀⠀⠀⠀⡇⡇⡇⠘⣄⡜⠀⠀⠀⠀⢸⠀⢸⠀⡔⠒⡇⠘⣄⡜⠀⠀⠇
⠈⠉⠉⠈⠉⠈⠉⠀⠉⠁⠉⠉⠀⠉⠉⠀⠈⠁⠈⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣀⠇⠀⠀⠉⠁⠀⠈⠉⠈⠀⠀⠀⠀⠈⠉⠀⠀⠉⠁⠁⠀⠁⠀⠀⠉⠁⠀⠈⠉⠈⠀⠀⠀⠈⠁⠁⠉⢀⡸⠀⠀⠀⠀⠀⠀⠉⠁⠁⠈⠉⠈⢀⡸⠀⠀⠀⠁
$
Your "history" trick did make the 308 million Carmichael numbers fit into my fast AMD 7950X CPU PC.
And that has fast DDR5 RAM and SSDs as storage, and not raid HDDs as my 2-socket server.
I started gp, did the read() and looked for gp pid in top.
Then I queried resident RAM after read() on command line:
hermann@7950x:~$ ps -o pid,user,vsz,rss,comm,args 4856
PID USER VSZ RSS COMMAND COMMAND
4856 hermann 42311356 24028804 gp gp -q
hermann@7950x:~$
Not 38/2 GB resident RAM but 23GB.
Now fits easily into 32GB RAM of my PC, and read time now is only 18 seconds!
hermann@7950x:~$ gp -q
? #
timer = 1 (on)
? b=read("carm10e24.bin");0
cpu time = 3,751 ms, real time = 17,627 ms.
0
? #b
308279939
? b[#b]
999999999855878641139521
? d=10^3;C=0;foreach(b,c,if(c>=d,print1(C",");d=d*10);C+=1);print(C)
1,7,16,43,105,255,646,1547,3605,8241,19279,44706,105212,246683,585355,1401644,3381806,8220777,20138200,49679870,123381982,308279939
cpu time = 56,718 ms, real time = 56,722 ms.
?
The last loop verifies the 10^n Carmichael number counts of https://oeis.org/A055553 .
The server I did download the 184GB file from was slow, so it took 4:58h(!) to download.
For people interested in Carmichael numbers
https://en.wikipedia.org/wiki/Carmichael_number
up to 10^24 I did upload the binary file to my personal website.
Depending on your download speed (I have 1Gbps cable internet) you can get it in 2min!
hermann@7950x:~/Downloads$ wget https://stamm-wilbrandt.de/carm10e24.bin
...
carm10e24.bin 100%[===================>] 11,45G 83,7MB/s in 1m 47s
2026-03-07 16:13:29 (109 MB/s) - ‘carm10e24.bin’ saved [12296962769/12296962769]
hermann@7950x:~/Downloads$ diff carm10e24.bin ~/carm10e24.bin
hermann@7950x:~/Downloads$ time sha256sum carm10e24.bin
964abcc780b9786ae9f18d75a688cfc83f2bf74fb592ead9f58fd94bf6441946 carm10e24.bin
real 0m5,355s
user 0m4,521s
sys 0m0,834s
hermann@7950x:~/Downloads$
Regards,
Hermann.