Obsolete Machine

Logic Level 3

A machine is showing the number 0. It has 4 buttons: + 2 \boxed{+2} , 2 \boxed{-2} , × 2 \boxed{×2} , and ÷ 2 \boxed{÷2} . If you press a button, the number that the machine is showing will be changed by the operation on the button. At least how many times do you need to press the buttons in order to make 2018?


The answer is 13.

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.

4 solutions

Henry U
Dec 28, 2018

It's important to note that 2016 is divisible by 16, so the last steps have to be ×2, ×2, ×2, ×2, +2. 2016 ÷ 16 = 126 2016 \div 16 = 126 . This is perfect because we can get to 128 by powers of 2, then subtract 2 and then do the previously described last steps for a total of 13 \boxed{13} .


Here they are:

0 = + 2 2 1 = × 2 4 2 = × 2 8 3 = × 2 16 4 = × 2 32 5 = × 2 64 6 = × 2 128 7 = 2 126 8 = × 2 252 9 = × 2 504 10 = × 2 1008 11 = × 2 2016 12 = + 2 2018 13 \begin{aligned} 0 & \stackrel{+2}{=} 2 \ & 1 \\ & \stackrel{\times 2}{=} 4 \ & 2 \\ & \stackrel{\times 2}{=} 8 \ & 3 \\ & \stackrel{\times 2}{=} 16 \ & 4 \\ & \stackrel{\times 2}{=} 32 \ & 5 \\ & \stackrel{\times 2}{=} 64 \ & 6 \\ & \stackrel{\times 2}{=} 128 \ & 7 \\ & \stackrel{-2}{=} 126 \ & 8 \\ & \stackrel{\times 2}{=} 252 \ & 9 \\ & \stackrel{\times 2}{=} 504 \ & 10 \\ & \stackrel{\times 2}{=} 1008 \ & 11 \\ & \stackrel{\times 2}{=} 2016 \ & 12 \\ & \stackrel{+2}{=} \boxed{2018} \ & \boxed{13} \end{aligned}

Abraham Zhang
Feb 9, 2019

Since 2018 = 2048 32 + 2 2018=2048-32+2 , we can make it by doing
0 + 2 2 1 × 2 4 2 × 2 8 3 × 2 16 4 × 2 32 5 × 2 64 6 × 2 128 7 2 128 2 8 × 2 256 4 9 × 2 512 8 10 × 2 1024 16 11 × 2 2048 32 12 + 2 2048 32 + 2 13. \begin{aligned} 0&\stackrel{+2}{\rightarrow}2 \qquad &&1\\ &\stackrel{\times2}{\rightarrow}4 &&2\\ &\stackrel{\times2}{\rightarrow}8 &&3\\ &\stackrel{\times2}{\rightarrow}16 &&4\\ &\stackrel{\times2}{\rightarrow}32 &&5\\ &\stackrel{\times2}{\rightarrow}64 &&6\\ &\stackrel{\times2}{\rightarrow}128 &&7\\ &\stackrel{-2}{\rightarrow}128-2 &&8\\ &\stackrel{\times2}{\rightarrow}256-4 &&9\\ &\stackrel{\times2}{\rightarrow}512-8 &&10\\ &\stackrel{\times2}{\rightarrow}1024-16 &&11\\ &\stackrel{\times2}{\rightarrow}2048-32 &&12\\ &\stackrel{+2}{\rightarrow}2048-32+2 &&13.\\ \end{aligned}

Enter in a calculator to see: 0 +2 *2 *2 *2 *2 *2 *2 -2 *2 *2 *2 *2 +2, except each +, * or - is separate.

Count the 2 2 s in IntegerDigits \text{IntegerDigits} 's first argument: IntegerDigits [ ( ( 0 + 2 ) 2 2 2 2 2 2 2 ) 2 2 2 2 + 2 , 2 ] = 11111100010 2 = 2018 10 \text{IntegerDigits}[((0 + 2) 2\ 2\ 2\ 2\ 2\ 2 - 2) 2\ 2\ 2\ 2 + 2,2]={11111100010}_2={2018}_{10} . The count is 13.

plz explain this!

Ishan Das - 2 years, 3 months ago

I really did mean count the 2 2 s in the first argument to the function call IntegerDigits. There are 13 2s. That is the answer.

The expression uses implicit multiplication (the spaces between 2 2 s).

"How did you solve the problem?" is what I believe is your actual question. I first represented 2018 10 {2018}_{10} as 11111100010 2 {11111100010}_2 . This told me how to construct the number: generate a string of 6 1 1 s, 3 0 0 s, a single 1 1 and a single 0 0 . Step 1: Starting from the 0 that the calculator starts with, add 2 2 to get 10 2 {10}_2 . Step 2: multiply by 2 2 6 times to get 10000000 2 {10000000}_2 , Step 3: Subtract 2 2 to get 1111110 2 {1111110}_2 , Step 4: Multiply by 2 2 four times to get 11111100000 2 {11111100000}_2 . Step 5: Add 2 2 to get 11111100010 2 {11111100010}_2 . The calculator working in decimal will show 2018 2018 .

To generate 2019: ( ( ( ( 0 + 2 ) 2 2 2 2 2 2 ) 2 2 2 2 + 2 ) 2 + 2 ) / 2 ((((0+2)*2*2*2*2*2-2)*2*2*2*2+2)*2+2)/2 .

A Former Brilliant Member - 2 years, 3 months ago

Thank You! This was helpful! <3

Ishan Das - 2 years, 3 months ago

So there is an algorithm to this problem? Wow!

Phượng Mai Liên Hồng - 2 years, 2 months ago

you are so brilliant

Hu HongRun - 2 years, 2 months ago

I miscounted, took me 14 steps: +2=2 *2=4 *2=8 *2=16 *2=32 *2=64 *2=128 *2=256 -2=254 -2=252 *2=504 *2=1008 *2=2016 +2=2018

Martha Sapeta - 1 year ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...