Skip to content

Instantly share code, notes, and snippets.

@jmccardle
Created July 8, 2023 16:44
Show Gist options
  • Save jmccardle/0f5e4fb48ab9f66da1f42035594c84bd to your computer and use it in GitHub Desktop.
Save jmccardle/0f5e4fb48ab9f66da1f42035594c84bd to your computer and use it in GitHub Desktop.
# See this diagram: https://i.redd.it/41iyyfdaliab1.png
from itertools import permutations
for i, perm in enumerate(permutations([1,2,3,4,6,8,9])):
a, b, c, d, e, f, g = perm
if (a + d + g + f) +1 == (b + d + e + g) -1 == (c * e * f * g +1)**0.5:
print(f"\n{i}. Solution: a = {a}, b = {b}, c = {c}, d = {d}, e = {e}, f = {f}, g = {g}, x = {(a+d+g+f)+1}")
elif i % 10 == 0:
print(f".", end='')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment