19 ms·
Here's a fairly fast algorithm: Look for a number that appears in both { j⁵+k⁵+l⁵ } and { i⁵-n⁵ } where 0 < j <= k <= l and 0 < n < i If we only consider l and
by nroets 10mo ago
Here's a fairly fast algorithm:
Look for a number that appears in both
{ j⁵+k⁵+l⁵ } and { i⁵-n⁵ }
where 0 < j <= k <= l and 0 < n < i
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 https://en.wikipedia.org/wiki/Strength_reduction