Getting to 1653

Probability Level pending

You start with 0 0 .

Then, as many times as you like, you can choose to perform one the following operations: + 1 +1 , × 2 \times 2 , or × 3 \times 3

What is the fewest number of operations you would need to perform to get to 1653 1653 ?


For example, you could get to 54 54 with the following operations:

0 + 1 × 3 × 3 × 3 × 2 0 \rightarrow +1 \rightarrow \times 3 \rightarrow \times 3 \rightarrow \times 3 \rightarrow \times 2

And, that would be considered 5 5 operations.


The answer is 12.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

1 solution

Geoff Pilling
Sep 9, 2016

The minimum number of operations can be solved by the following recursion relation:

  • A ( 0 ) = 0 A(0) = 0
  • A ( n ) = 1 + m i n ( A ( n 1 ) ; f 2 ( n ) ; f 3 ( n ) ) A(n) = 1 + min(A(n-1);f_2(n);f_3(n)) for n > 0 n>0

Where f i ( n ) = n i f_i(n) = \frac{n}{i} if n n divides by i i , \infty otherwise

This is because there are at most three ways to get to n n :

  • from n 1 n-1
  • from n / 3 n/3 (if n n divides by 3 3 )
  • from n / 2 n/2 (if n n divides by 2 2 ).

Solving, A ( 1653 ) = 12 A(1653) = \boxed{12}

One such minimal set of operations to give you 1653 1653 is the following:

+ 1 × 3 × 3 + 1 × 2 × 3 + 1 × 3 × 3 + 1 + 1 × 3 +1 \rightarrow \times 3 \rightarrow \times 3 \rightarrow +1 \rightarrow \times 2 \rightarrow \times 3 \rightarrow +1 \rightarrow \times 3 \rightarrow \times 3 \rightarrow +1 \rightarrow +1 \rightarrow \times 3

And I know that @Pi Han Goh is going to want me to find a simpler solution that doesn't involve recursion like this, and, yes, I'll think about that, but for now this is the best I got! :-P

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...