Proofs of Existence and Optimality · Difficult Problems in Number Theory (Optional)
Lesson 5
As a counterexample to Euler's hypothesis, one may take the following set of numbers: \[a=95800,\ b=217519,\ c=414560,\ d=422481\ .\] It is easy to verify its correctness:
print(95800 ** 4 + 217519 ** 4 + 414560 ** 4 == 422481 ** 4)True
It is known that this is the only such quadruple of numbers where all numbers are less than a million. For \(n=5\), the minimal counterexample will have smaller numbers—see the screenshot of one of the shortest scientific articles.
=4/image0.png)
For the curious 🤓
This code will run for a long time. It can be sped up, for example, as follows: from itertools import product
for a, b, c, d, e in product(range(1, 150), repeat=5):
if a ** 5 + b ** 5 + c ** 5 + d ** 5 == e ** 5:
print(a, b, c, d, e)
break
The resulting optimized code will run much faster. from itertools import combinations
powers = {i ** 5 for i in range(1, 150)}
print(next(c for c in combinations(powers, 4) if sum(c) in powers))