3
$\begingroup$

Suppose you start with the number $102$ and, at each step, you are allowed to double the number, add the number's digits, multiply its digits, or add 1. Your goal is to go from $102$ to $201$ in as few steps as possible. Of course, you could add $1$ $99$ times, but... where's the fun in that? Here is my best attempt:

$102 \to 3 \to 6 \to 12 \to 24 \to 25 \to 50 \to 100 \to 200 \to 201$

$\endgroup$
  • 3
    $\begingroup$ Your attempt is indeed the least amount of steps possible. $\endgroup$ – Pjotr5 May 21 '17 at 20:02
  • 1
    $\begingroup$ @Frpzzd Yes, The other two paths result in the same answer of 9, with the beginning being multiply by two, then add the digits, being 102 -> 204 -> 6... or once again multiply to make 102 -> 204 -> 408 -> 12 ... $\endgroup$ – ben-Nabiy Derush May 21 '17 at 20:12
  • 6
    $\begingroup$ ‮ ‮Just add a right to left character in front of the 102 and it'll become 201 in a jiffy. D: $\endgroup$ – Simply Beautiful Art May 21 '17 at 22:06
  • 1
    $\begingroup$ Just don't use excessively or you will get in trouble. (gives the serious look) $\endgroup$ – Simply Beautiful Art May 21 '17 at 22:40
  • 2
    $\begingroup$ I can do it in zero mathematical steps by turning my calculator upside-down.... $\endgroup$ – Hellion May 22 '17 at 18:31
3
$\begingroup$

The short answer is:

No - there is not a shorter path

but

there are alternate paths. You can start the sequence with 102 doubled is 204 summed is 6...

or

Start with 102 doubled is 204 doubled is 408 summed is 12...

$\endgroup$
12
$\begingroup$

Your attempt uses the least amount of steps possible. I have written a computer program that calculates the shortest possible paths between $102$ and $201$ and it has found four with nine steps. I believe that these are all of them:

\begin{align*}102 \to 3 \to 6 \to 12 \to 24 \to 25 \to 50 \to 100 \to 200 \to 201\end{align*} \begin{align*} 102 \to 204 \to 6 \to 12 \to 24 \to 25 \to 50 \to 100 \to 200 \to 201 \end{align*} \begin{align*} 102 \to 204 \to 408 \to 12 \to 24 \to 25 \to 50 \to 100 \to 200 \to 201 \end{align*} \begin{align*} 102 \to 204 \to 408 \to 816 \to 48 \to 49 \to 50 \to 100 \to 200 \to 201 \end{align*}

I find the last one the most interesting.

$\endgroup$
  • 2
    $\begingroup$ That last one is interesting... the only one that uses the product of the digits. $\endgroup$ – Frpzzd May 21 '17 at 20:31
  • $\begingroup$ @Pjotr5 can you share the logic of the computer program you made? It interests me. $\endgroup$ – prog_SAHIL May 22 '17 at 14:22
  • 1
    $\begingroup$ Glad you posted your answer as well. I missed that last one. $\endgroup$ – ben-Nabiy Derush May 23 '17 at 3:25
  • 3
    $\begingroup$ @prog_SAHIL The program was nothing clever, just naive brute-force. It took a list of all paths of length $n$ and outputted all paths of length $n+1$. So for $\{\{102\}\}$ it would output $$\{\{102, 204\}, \{102, 3\}, \{102, 0\}, \{102, 103\}\}.$$ Then at each step it would check if $201$ was already reached. Because I knew it would terminate after at most $9$ iterations, I knew brute-force would be plenty fast enough. $\endgroup$ – Pjotr5 May 23 '17 at 14:03
  • $\begingroup$ @Pjotr5 Thanks for the explanation :) $\endgroup$ – prog_SAHIL May 23 '17 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.