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
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers13
Suggested Problems
-
1744 Solvers
-
274 Solvers
-
Characterize the final state of the digit inventory sequence
18 Solvers
-
Easy Sequences 2: Trigonometric function with integral input and output
43 Solvers
-
Split Even Number Into Two Primes
213 Solvers
More from this Author323
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
Chris, -- In the first example, is the fourth number supposed to be 312 rather than 112, or am I misunderstanding the description?
Yes, you're right. Thanks. If you start with 1, you will see why I made that mistake.