Problem 46040. Solve a Weird Calculator puzzle
The September 2012 issue of GAMES Magazine had a Weird Calculator puzzle by Erich Friedman. In this puzzle, the calculator has only four buttons: +13, -7, ×2, and /3. The object is to add 1 to get from one number to another with the specified number of button presses. For example, if you were asked to get from 8 to 9 in two button presses, you could press ×2 and -7.
Write a function to solve the Weird Calculator puzzle. The input will be the starting number a, the desired result b, and the number n of button presses. The output should be a string with the buttons separated by a comma and a space. For the example above, the output should be
*2, -7
Enjoy!
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers12
Suggested Problems
-
281 Solvers
-
Determine if input is a Narcissistic number
213 Solvers
-
Generate a vector like 1,2,2,3,3,3,4,4,4,4
13502 Solvers
-
Find Index of maximum Value and maximum Value of a vector
167 Solvers
-
Create Volcano (or Atoll) martix. It is an extension of Bullseye matrix problem.
159 Solvers
More from this Author316
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!