0 1 2 3 4 5 = = = = = = 2 − 3 − 4 + 5 ( 2 − 3 ) × ( 4 − 5 ) 3 − 2 − 4 + 5 2 × ( 3 − 4 ) + 5 2 + 3 + 4 − 5 2 − 3 × ( 4 − 5 )
Above shows the first 6 non-negative integers formed by using the four mathematical operators ( + − × ÷ ) from the integers 2, 3, 4, 5 (each of which is used exactly once).
What is the smallest positive integer that cannot be represented using these conditions?
Details and Assumptions :
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 8 = 3 × ( 2 × 5 − 4 ) , 2 8 = 4 × ( 2 × 5 − 3 ) .
Yay! You got the reference!
Log in to reply
BTW for 4 we also have ( 4 − 2 ) × ( 5 − 3 ) as another possible solution. And 3 can also be expressed as ( 4 − 3 ) × ( 5 − 2 ) .
How was I supposed to get it, trial and error is the only way?
Log in to reply
Read the title of this problem.
Yup! Cannot forget a line from a movie. And how in the world did I miss that! Makes sense that I didn't get both. :/ Can we prove that 32 is impossible?
Log in to reply
I'm not sure how to attempt this. Sounds like a NP problem. Got any idea?
Log in to reply
@Pi Han Goh – I think we can brute force it by taking all permutations of numbers and operators(using a computer of course). But otherwise, I am as clueless as you are.
@Pi Han Goh – Is there any relation between:
Hey 3 2 is not a polite number! and,
this question?
@Raghav Vaidyanathan @Pi Han Goh
Log in to reply
@Sravanth C. – 3 2 is not a polite number -_- .Please review their definition again!
Log in to reply
@Nihar Mahajan – Thanks! edited.
Log in to reply
@Sravanth C. – Then by your reasoning , even 2 , 4 , 8 , 1 6 are impolite. Then why can they be represented whereas 3 2 cannot be represented?
Log in to reply
@Nihar Mahajan – Yeah. I was thought about that too, but I think there is some relation . . .
@Pi Han Goh – Actually , it can be proved or at least pointed out clearly that 32 is an impossible case if you are a little bit attentive. Observe that the 4 numbers can have only operations possible with those 4 operators and therefore there will 3 operators used in each possible expression. Now observe that there can be at most 3 different used and that for 32 this cases can be thought of in some terms regarding their quantity being possible to firstly prove that there is necessary at least one * operator because addition would give at most 14. From this there are some other cases in which either there is only one * operator used or more and for using just a single operator then it means that there is a number from those numbers which multiplied with the result (or combination) of the expression of the other 3 gives 32. That number then will either divide 32 and those numbers can be either 4 or 2 but doesn't give a solution or can't divide it and then those numbers are resulting numbers from the combination of 2 other numbers which should give the expression of 4 * 8 ( because the other possibility 2*16 is already included in the other case and therefore would be fallacious to put it here since 2 is already included and there is no way to get 16 also). However there can't be obtained by the combination of 2 terms 4 and also 8 and I'll not put the details either. Therefore there are exhausted all the possible simplified cases for one * operator of the numbers , since there are used in this cases the multiplication between already given terms and the result of the other 3 and also the combination of the results of combinations of numbers. For the case where there are used more than just 1 * operator observe that the result grows pretty big or pretty small and therefore implies in the cases where the resulting number is bigger the / operator but those cases are easy to check from there. Therefore , it is impossible and while maybe there is possible a synthetic approach using the number of terms which imply some operator and the quantitative relations between consecutive numbers this can be sufficient to see by some understanding of their relations. In this way there is some organizing of those stuff so that there can be said that is pointed out or proved why it is not possible. Such an approach considers what can be called the way such number behave under this operations and develops an understanding of it which in more or less a way can be said that is also the understanding which is tried to be achieved in such "arithmetic" questions anyways.
Log in to reply
@A A – I appreciate your detailed writeup, but your explanation lacks rigor. If I replace the numbers 2,3,4,5 with some other 4 consecutive integers, I'm pretty sure your argument will not hold.
Log in to reply
@Pi Han Goh – Oh , of course it wouldn't. I just wanted to prove it for this case as it at least to me seems requested.
Log in to reply
@A A – Oh okay! Great! I see that you're solving plenty of my problems lately. Haha!
Log in to reply
@Pi Han Goh – Yea , a lot of them wrongly too anyways and they are cute. I have an unclarity at "large tic tac toe 4" cause I think there is a solution in 5 steps of X but I doubt I'm right. Hope you'll solve mine's too when you will want and have time and I'll post a new one also. Anyways , regarding this problem I thought at a synthetic solution for this particular case (using the 4 consecutive numbers in the problem) but I'm not done yet. Understanding this kind of things to me almost always implies getting them by the principles. It may be that it is NP indeed thought first thought can be misleading without rigor and a solution by checking cases even if is a solution can still be understood more or less rationally relating the ordering of the procedure and stuff like that , I'm rarely satisfied (even if for practical uses it may be enough) with just checking cases.
Log in to reply
@A A – Feel free to report my question, I'll respond to it when I'm free.
I listed every possible outcome, or all the numbers possible with 2 , 3 , 4 , 5 . I'm crazier than u hahahahhavabipjdknva
good solution
I assume that BIDMAS is completely disregarded in thus problem
You are as crazy as me. My first try was 20 and then 31. And then I tried getting 32, coundn't. I got 33 and couldn't get 34. After trying literally everything, I HOPED 32 would be the answer (since I had only 1 try left). And... Bingo!
I wrote a python program to attempt and calculate all the possible value which can be formed by 2,3,4,5. Basically a brute force and not really optimized since we are interested only for small numbers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
|
The values I got [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 36, 37, 38, 39, 40, 42, 43, 44, 45, 46, 48, 49, 50, 52, 54, 55, 58, 62, 64, 66, 68, 70, 84, 90, 100, 120]
Which proves that the smallest such number is 32 With a small code change you can also get the actual expression for this value.
I wrote a computer program (a while back) that was adaptable to this. I confirmed that 32 was the first positive integer not obtainable.
Of course, if you throw in square roots and powers you get much farther. Add factorials, ...
Yes, I'm like a crazy person!
Can you add the code that you used?
Log in to reply
It's not very elegant (and very long) C code from many years ago. The Python code already posted is certainly more instructive.
Problem Loading...
Note Loading...
Set Loading...
6 = 2 × 3 × ( 5 − 4 ) 7 = 5 + 2 × ( 4 − 3 ) 8 = 4 + 2 × ( 5 − 3 ) 9 = 5 + 4 × ( 3 − 2 ) 1 0 = ( 5 − 3 ) + ( 4 × 2 ) 1 1 = 5 + 3 × ( 4 − 2 ) 1 2 = ( 5 + 4 − 3 ) × 2 1 3 = ( 4 + 2 ) × 3 − 5 1 4 = ( 5 × 4 ) − ( 3 × 2 ) 1 5 = ( 5 × 4 ) − 3 − 2 1 6 = ( 5 + 3 ) × ( 4 − 2 ) 1 7 = ( 5 × 3 ) + ( 4 − 2 ) 1 8 = ? ? ? T r y 1 1 9 = ( 4 × 3 × 2 ) − 5 2 0 = ( 5 + 3 ) × 2 + 4 2 1 = ( 5 × 3 ) + 4 + 2 2 2 = ( 5 × 2 ) + ( 3 × 4 ) 2 3 = ( 5 × 3 ) + ( 4 × 2 ) 2 4 = 2 × ( 3 + 4 + 5 ) 2 5 = ( 2 + 3 ) × 4 + 5 2 6 = ( 4 × 5 ) + ( 2 × 3 ) 2 7 = ( 2 + 4 ) × 5 − 3 2 8 = ? ? ? T r y 2 2 9 = 5 × ( 2 + 3 ) + 4 3 0 = ( 3 + 5 ) × 4 − 2 3 1 = ( 2 + 5 ) × 4 + 3 3 2 = ? ? ? T r y 3 3 3 = 5 × ( 4 + 2 ) + 3