Skip to content

Instantly share code, notes, and snippets.

@djsmith42
Created March 11, 2013 04:20
Show Gist options
  • Save djsmith42/5131866 to your computer and use it in GitHub Desktop.
Save djsmith42/5131866 to your computer and use it in GitHub Desktop.
import itertools
for a, b, c, d, e, f in itertools.product(range(1, 10), range(1, 10), range(1, 10), range(1, 10), range(1, 10), range(1, 10)):
if (a + b + c == 18 and
d + e + f == 18 and
a + d == b + e and
b + e == c + f and
int(str(e) + str(f)) in [16, 25, 36, 49, 64, 81] and
len(set([a, b, c, d, e, f])) == 6):
print a, b, c, d, e, f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment