A machine is showing the number 0. It has 4 buttons: + 2 , − 2 , × 2 , and ÷ 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?
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.
Since
2
0
1
8
=
2
0
4
8
−
3
2
+
2
, we can make it by doing
0
→
+
2
2
→
×
2
4
→
×
2
8
→
×
2
1
6
→
×
2
3
2
→
×
2
6
4
→
×
2
1
2
8
→
−
2
1
2
8
−
2
→
×
2
2
5
6
−
4
→
×
2
5
1
2
−
8
→
×
2
1
0
2
4
−
1
6
→
×
2
2
0
4
8
−
3
2
→
+
2
2
0
4
8
−
3
2
+
2
1
2
3
4
5
6
7
8
9
1
0
1
1
1
2
1
3
.
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 s in IntegerDigits 's first argument: IntegerDigits [ ( ( 0 + 2 ) 2 2 2 2 2 2 − 2 ) 2 2 2 2 + 2 , 2 ] = 1 1 1 1 1 1 0 0 0 1 0 2 = 2 0 1 8 1 0 . The count is 13.
plz explain this!
I really did mean count the 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 s).
"How did you solve the problem?" is what I believe is your actual question. I first represented 2 0 1 8 1 0 as 1 1 1 1 1 1 0 0 0 1 0 2 . This told me how to construct the number: generate a string of 6 1 s, 3 0 s, a single 1 and a single 0 . Step 1: Starting from the 0 that the calculator starts with, add 2 to get 1 0 2 . Step 2: multiply by 2 6 times to get 1 0 0 0 0 0 0 0 2 , Step 3: Subtract 2 to get 1 1 1 1 1 1 0 2 , Step 4: Multiply by 2 four times to get 1 1 1 1 1 1 0 0 0 0 0 2 . Step 5: Add 2 to get 1 1 1 1 1 1 0 0 0 1 0 2 . The calculator working in decimal will show 2 0 1 8 .
To generate 2019: ( ( ( ( 0 + 2 ) ∗ 2 ∗ 2 ∗ 2 ∗ 2 ∗ 2 − 2 ) ∗ 2 ∗ 2 ∗ 2 ∗ 2 + 2 ) ∗ 2 + 2 ) / 2 .
Thank You! This was helpful! <3
So there is an algorithm to this problem? Wow!
you are so brilliant
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
Problem Loading...
Note Loading...
Set Loading...
It's important to note that 2016 is divisible by 16, so the last steps have to be ×2, ×2, ×2, ×2, +2. 2 0 1 6 ÷ 1 6 = 1 2 6 . 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 1 3 .
Here they are:
0 = + 2 2 = × 2 4 = × 2 8 = × 2 1 6 = × 2 3 2 = × 2 6 4 = × 2 1 2 8 = − 2 1 2 6 = × 2 2 5 2 = × 2 5 0 4 = × 2 1 0 0 8 = × 2 2 0 1 6 = + 2 2 0 1 8 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3