A few years ago, while browsing for books in PowerBooks, I noticed a book containing plenty of puzzles. I tried solving some of them, but most of them cannot be solved without the aid of a scratch paper. There’s one, however, that I was able to memorize because of the absolute simplicity of the problem. The idea is to distribute the numbers 0-9 in a 2×3=5 equation so that each numbers appear exactly once. There are no hints, but a single digit was already supplied.
It’s a tough problem, admittedly. I had previously solved a similar problem before, admittedly through luck. The problem is to decode the equation BUG + FLY = MOTH, which contains 10 unique letters, meaning the numbers 0 – 9. Multiplication is far more complex than addition because of the carry-overs. Worse, the puzzle appeared not just once, but 5 times, if I’m not mistaken.
Note: If you don’t want to read the technical details and just want to view the answers, just skip the next few pages and head over the last page by clicking on its link.
A few years later, I have completely forgotten the puzzle. Then, suddenly, a few weeks ago, I suddenly remembered this puzzle, ironically while fiddling with Mathematica (actually, struggling is the more accurate word, since Mathematica has a very unconventional and difficult syntax). I decided to solve this programmatically. Creating the pseudocode is easy enough:
Create an array of digits from 0 – 9 in increasing order, but with 0 as the last element.
Create a loop. In each loop make two numbers made of elements in the array, then remove the corresponding value in the array. The idea is to create a 3-digit and two digit number using every possible combination, with the two numbers not starting with 0.
Get the product of the two numbers, then test it against the remaining array. No digit should be duplicated in the array.
Display the result if it satisfies the test.