Skip to content

Instantly share code, notes, and snippets.

@Spaxe
Created April 7, 2011 15:45
Show Gist options
  • Save Spaxe/908037 to your computer and use it in GitHub Desktop.
Save Spaxe/908037 to your computer and use it in GitHub Desktop.
Pixel.io's crytarithm brute force solution
# WWW * GPU = PIXEL I/O
# X = 6
# O != 1
from itertools import permutations
for digits in permutations(d for d in range(10) if d != 6):
W, G, P, U, I, E, L, O = digits[:8]
if (O != 1 and O * (W*100+W*10+W) * (G*100+P*10+U) == (P*100000+I*10000+6000+E*100+L*10+I)):
print ("{}{}{} * {}{}{} = {}{}6{}{} {}/{}".format(W, W, W, G, P, U, P, I, E, L, I, O))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment