Created
July 5, 2023 17:48
-
-
Save jmccardle/d6dd9c1576542269f0612574941de771 to your computer and use it in GitHub Desktop.
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
# See diagram: https://i.imgur.com/UWDrqcH.png | |
from itertools import permutations | |
for i, perm in enumerate(permutations([1,2,3,4,5,6,7])): | |
a, b, c, d, e, f, g = perm | |
if (a + d + g + f) / 2 == (b + d + e + g) / 3 == (c + e + f + g) / 4: | |
print(f"\n{i}. Solution: a = {a}, b = {b}, c = {c}, d = {d}, e = {e}, f = {f}, x = {(a+d+g+f)/2}") | |
else: | |
print(f"{i} ", end='') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment