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!
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.
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!
FWIW on my W541, Slackware I get
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.
See also
https://community.intel.com/t5/image/serverpage/image-id/116...
I like the bald guy in the comments idea golfing and posting his own numbers.
For a limit of 10,000⁵. Reading https://www.ams.org/journals/mcom/1967-21-097/S0025-5718-196... the original search seems to have gone up to 250⁵. That’s a search space that’s 40⁵ ≈ 10⁸ larger.
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⁵.
It's likely that the original search also used strength reduction to save a lot of cycles (effectively replacing all multiplications with additions):
https://en.wikipedia.org/wiki/Strength_reduction