Created
February 24, 2016 10:10
-
-
Save jakobkogler/fb276d0a2bb51cd84fc3 to your computer and use it in GitHub Desktop.
Valid move sequences on one axis on a 13x13x13 cube
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 product | |
disallow = 0 | |
for move in product([0, 1, 2, 3], repeat=13): | |
A, B, C, D = [move.count(i) for i in range(4)] | |
if max(A, B, C) > D: | |
disallow += 1 | |
total = 4**13 - 1 # empty sequence | |
print('keep {} / {} move sequences'.format(total - disallow, total)) | |
# output: | |
# keep 21281715 / 67108863 move sequences |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment