Created
January 17, 2016 06:44
-
-
Save anonymous/687c4b2021da0dbbff01 to your computer and use it in GitHub Desktop.
shufflemult.py
This file contains hidden or 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
| from itertools import permutations | |
| seen = dict() | |
| i = 0 | |
| while True: | |
| current = sorted(set([int("".join(j)) for j in list(permutations(str(i)))])) | |
| if current[-1] not in seen: | |
| for j in current: | |
| seen[j] = True | |
| # print current | |
| answers = dict() | |
| for j in current: | |
| for k in [l for l in current if l > j]: | |
| if j * k not in answers: | |
| answers[j * k] = [] | |
| answers[j * k].append(str(j) + " * " + str(k)) | |
| for j in answers: | |
| if len(answers[j]) > 1: | |
| print " = ".join(answers[j]) | |
| i += 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment