Problem 49572. Compute the largest number possible with the Brussels choice
The Brussels choice (or Choix de Bruxelles) operation changes one number to another by taking a substring of the digits and either doubling it or (if the number is even) halving it. For example, starting with 9 and highlighting substrings, one can generate this sequence:
9, 18, 36, 312, 622, 644, 1288, 1488,...
Another possibility is
9, 18, 116, 232, 464, 924, 1844, 1888,...
Both of these excerpts have eight entries, but the second ends in a larger number than the first.
Write a function that takes an initial value and determines the largest number resulting after n steps. In the above examples, = 9 and . Return the number as a character string.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers12
Suggested Problems
-
Find the alphabetic word product
3239 Solvers
-
Project Euler: Problem 6, Natural numbers, squares and sums.
2047 Solvers
-
Given a window, how many subsets of a vector sum positive
847 Solvers
-
Set the array elements whose value is 13 to 0
1343 Solvers
-
Two-output anonymous function?
72 Solvers
More from this Author249
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!