A calculator, initially displaying 0, has only two buttons: ”+” adds 1 to the number on display, and ”×” multiplies the number on display by 10.
What is the least number of button presses needed to show 5034? And how would you make sure your solution is actually optimal, not just a good guess? (Puzzle courtesy of Hakan Kjellerstrand.)
Send your solutions to DecisionManagementCommunity@gmail.com, or open a pull request to add yours here.
One submitted solution (Prolog, by Matteo Redaelli) was originally published as an external write-up whose link no longer resolves. If you’re the author (or know a working link), please open a pull request adding the
urlfield back.