Re precomputing fifth powers, seems Fortran not only has array comprehensions, but compile-time array comprehensions. It was never exactly my cup of tea, but nearly 40 years out of university it seems Fortran has kinda kept up!
nurettin 2 days ago [-]
I like the bald guy in the comments idea golfing and posting his own numbers.
Output is the same, which is aloways good. But times are slower because I am on a ~10 year old system :)
So I gave it a whirl on sdf.org's Debian system
Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux kenel 6.1.0-37-amd64
real 1m9.615s
user 1m9.595s
sys 0m0.016s
That system is a true multi user system and had 54 users logged in when I ran it. So I think it is better than I expected.
FWIW, I believe my first paid job was on a 6600 while in college, but it could have been a 7600. There were upgrading the system from the 6600 when I was there.
Rendered at 07:38:17 GMT+0000 (Coordinated Universal Time) with Vercel.
If we only consider l and i under 250, then the sets would contain less than 3 million integers each.
Strength reduction can be used to replace all the multiplications with additions: https://en.wikipedia.org/wiki/Strength_reduction
They also forget to break out of the loops when the sum of, say, the first three fifth powers already is larger than 10,000⁵.
https://en.wikipedia.org/wiki/Strength_reduction
https://community.intel.com/t5/image/serverpage/image-id/116...
i^5 = 61917364224 j^5 + k^5 + l^5 + n^5 = 61917364224 27 84 110 133 144
Slackware W541:
real 1m6.703s
user 1m6.658s
sys 0m0.002s
Output is the same, which is aloways good. But times are slower because I am on a ~10 year old system :)
So I gave it a whirl on sdf.org's Debian system Debian 6.1.140-1 (2025-05-22) x86_64 GNU/Linux kenel 6.1.0-37-amd64
real 1m9.615s
user 1m9.595s
sys 0m0.016s
That system is a true multi user system and had 54 users logged in when I ran it. So I think it is better than I expected.
FWIW, I believe my first paid job was on a 6600 while in college, but it could have been a 7600. There were upgrading the system from the 6600 when I was there.