Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>>
- >>> import itertools as it
- >>> a, d, b, g, e, c, f = range(7)
- >>> for s in it.permutations(range(1, 10), 7):
- if s[a]*s[b]*s[c] == s[b]*s[g]*s[e] == s[d]*s[e]*s[f]:
- print s
- (1, 3, 9, 2, 4, 8, 6)
- (1, 6, 9, 2, 4, 8, 3)
- (3, 1, 4, 2, 9, 6, 8)
- (3, 8, 4, 2, 9, 6, 1)
- (6, 1, 4, 2, 9, 3, 8)
- (6, 8, 4, 2, 9, 3, 1)
- (8, 3, 9, 2, 4, 1, 6)
- (8, 6, 9, 2, 4, 1, 3)
- >>>
Advertisement
Add Comment
Please, Sign In to add comment