-
-
Save cklein/3800064 to your computer and use it in GitHub Desktop.
Sum of 4th powers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numbers = {} | |
for i in range(1, 200): | |
for j in range(1, 200): | |
number = i ** 4 + j ** 4 | |
numbers.setdefault(number, set()).add(tuple(sorted((i, j)))) | |
print min(dict((number, pairs) for number, pairs in numbers.items() if len(pairs) > 1)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment