A malfunction calculator can only perform calculation using " 7 " , " 0 " and " + " keys. That means number such as " 7 7 7 0 7 " could still be keyed-in for the addition operation. What is the least number of times that the " 7 " key must be used in the addition process to view " 2 2 2 2 2 2 " on its screen?
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.
Nice solution! But can't you just divide 222222 by 7 in the first place instead of prime factorizing?
Log in to reply
Haha good point!
When I thought of the solution, I didn't realize that any number that the 7's could describe would divide by 7. I wrote the solution using the methods I used, not necessarily the most optimal.
I did the exact same !!
Firstly, we need to understand that it doesn't matter how many additions you make, only how many times you use the number 7 . Then we want to minimize the number of times we use 7 .
So first we see how many times 7 0 , 0 0 0 goes into 2 2 2 , 2 2 2 , which is 3 . --------------------- 3
7 0 , 0 0 0 × 3 = 2 1 0 , 0 0 0
2 2 2 , 2 2 2 − 2 1 0 , 0 0 0 = 1 2 , 2 2 2
Now we want to now how many times 7 , 0 0 0 goes into 1 2 , 2 2 2 , which is 1 .------------------ 1
1 2 , 2 2 2 − 7 , 0 0 0 = 5 , 2 2 2
7 0 0 goes into 5 , 2 2 2 7 times.------------------------------------------------------------------------------------------------ 7
7 0 0 × 7 = 4 , 9 0 0 ; 5 , 2 2 2 − 4 , 9 0 0 = 3 2 2
7 0 goes into 3 2 2 4 times.-------------------------------------------------------------------------------------------------------- 4
7 0 × 4 = 2 8 0 ; 3 2 2 − 2 8 0 = 4 2
4 2 / 7 = 6 ----------------------------------------------------------------------------------------------------------------------------------------------- 6
Adding these: 3 + 1 + 7 + 4 + 6 = 2 1
This can all be simplified to 2 2 2 , 2 2 2 / 7 = 3 1 7 4 6 .
Again 3 + 1 + 7 + 4 + 6 = 2 1 , adding the sum of the digits. This will work in general cases of this problem, but might not be obvious from the beginning.
So the answer is 2 1
Nice explanation ... :)
Extension: What's the minimum number of integers you have to use to get 2 2 2 2 2 2 ?
222222/7 = 31746 ----> 3 + 1 + 7 + 4 + 6 = 21
Why do I never se the easy way. This seems so simple but I just had to do it the hard way by backtracking.
Can you please elaborate, I didn't understand this way of solving
Yes, what is the theorem that defines that this will work? Does it always work.
Let's assume that we use a + b + c + d + e number of " 7 " keys where we type the 7 0 0 0 0 a times, 7 0 0 0 b times, 7 0 0 c times, 7 0 d times, and 7 e times.
a
×
7
0
0
0
0
+
b
×
7
0
0
0
+
c
×
7
0
0
+
d
×
7
0
+
e
×
7
=
2
2
2
2
2
2
7
(
1
0
0
0
0
a
+
1
0
0
0
b
+
1
0
0
c
+
1
0
d
+
e
)
=
2
2
2
2
2
2
1
0
0
0
0
a
+
1
0
0
0
b
+
1
0
0
c
+
1
0
d
+
e
=
3
1
7
4
6
" 1 0 0 0 0 a + 1 0 0 0 b + 1 0 0 c + 1 0 d + e " can be written as the number " a b c d e "
a b c d e = 3 1 7 4 6
Therefore, a + b + c + d + e = 3 + 1 + 7 + 4 + 6 = 2 1
I'll work backwards, trying to reach 0 from 222,222 by subtraction.
Note that subtracting 777 for example is the same as subtracting 700, 70, and 7, with the same amount of 7's. If we subtract numbers made up just of 7's, we may end up adding ten 7's from the same place value, which is the same as one from a higher place value. It is thus optimal to subtract in this way:
2 2 2 , 2 2 2 − 7 0 , 0 0 0 − 7 0 , 0 0 0 − 7 0 , 0 0 0 − 7 , 0 0 0 − 7 0 0 − 7 0 0 − 7 0 0 . . . = 0
Subtracting the highest 7 ∗ 1 0 n that we can until we reach 0. This way we will never repeat the same place value ten times, making this the optimal method. Doing this we can count that the amount of 7's is 2 1
Because we must use the least number of times of 7 so first we use 70000*3=210000 which use 7 ,
_ 3 times _
Now it is left 222222-210000=12222 next we use 7000 which use 7 , _ 1 times _
Now it is left 12222-7000=5222 next we use 700*7=4900 which use 7, _ 7 times _
Now it is left 5222-4900= 322 next we use 70*4=280 which use 7, _ 4 times _
Now it is left 322-280=42 use 7 another. 6 times
So all we use is 3+1+7+4+6= 21 times
Problem Loading...
Note Loading...
Set Loading...
2 2 2 2 2 2 = 2 × 3 × 7 × 1 1 × 1 3 × 3 7 = 7 × 3 1 7 4 6 = 7 × ( 3 × 1 0 4 + 1 × 1 0 3 + 7 × 1 0 2 + 4 × 1 0 1 + 6 × 1 0 0 ) One way to type this on the calculator looks like this 7 7 7 7 7 + 7 0 7 7 7 + 7 0 7 7 7 + 7 7 7 + 7 0 7 + 7 0 7 + 7 0 0 In the ten thousands place, the number 7 is added 3 times, in the thousands place, the number 7 is added once, and so on and so forth. The number of 7's in this particular method is 21, but in any method of addition, the number of 7's used is equal to 3 + 1 + 7 + 4 + 6 = 2 1 .
Thus, the answer is 2 1