I got a note from Karim Lahrichi, who even thinks about math when he’s supposed to be drinking beer. The bar puzzle they were trying to solve goes like this: Using all of the numbers 1, 3, 4, 6 exactly once, and any combination of: addition, subtraction, multiplication and division (and parenthesis to group operations however you like), arrive at the number: 24.
Sounds easy, right? Until you try to find the answer…
Based on his code, it would also be straight forward to answer such world-shaking questions as: how many different ways to combine the numbers are there? Is there more than one solution to the puzzle? If yes, how many? Why are we looking for 24, shouldn’t we rather be looking for 42?
Anyway, if you like that sort of thing, make sure you check out this post too: solving Tic-Tac-Toe.