Skip to content

Instantly share code, notes, and snippets.

@ultimatecoder
Created December 22, 2017 08:09
Show Gist options
  • Save ultimatecoder/c7c4f8e7f5906a0a5eae94318ef14100 to your computer and use it in GitHub Desktop.
Save ultimatecoder/c7c4f8e7f5906a0a5eae94318ef14100 to your computer and use it in GitHub Desktop.
def count_order_n3(n):
results = []
for a in range(1, n+1):
for b in range(1, n+1):
for c in range(1, n+1):
d = a + b - c
if a ** 3 + b ** 3 == c ** 3 + d ** 3:
results.append((a, b, c, d))
return results
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment