You wake up in a locked cell, a bit shaken up but with all faculties intact. When you get to the cell-door you see a Number Pad with an attached note that has the following instructions...
"I am Professor Mad Math. I have imprisoned you! The only way to escape is to punch in the correct Code into the Number Pad. The 1 0 digit Code is made up of digits 0 − 9 inclusive, each digit used exactly once. These are the clues to crack my Code---
The sum of the middle two digits is a Square Number.
The sum of the middle four digits is a Cube number
The net difference between the first and tenth digit is 2
The net difference between the second and ninth digit is 3
The net difference between the third and eighth digit is 4
The sum of the first five digits is a Prime number
The sum of the last five digits is a Triangular number
The sum of the digits in odd positions (first, third, fifth, seventh and ninth digits) is an Odd number
The digit 4 is somewhere in the first five positions
I believe I have given you more than adequate information. Can you crack the Code?"
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.
The hint that the sum of the digits in odd positions is odd is apparently not needed. (I also did not use it, basically following your approach, but in a different order).
With these questions, I tend to pick every single possible option that leads to a dead end, before finally getting the correct answer...
Anyway, I have a different approach. We begin with the first two clues. From there, we can shortlist the possible options:
Sum of middle two digits: 1 , 4 , 9 , 1 6 (No two distinct digits will give you a sum more than 17)
Sum of middle four digits: 8 , 2 7 (No four distinct digits will give you a sum less than 6 or more than 30)
If sum of squares is 9 , we cannot get 2 7 because the maximum sum of those digits is 2 6 . Therefore, we have only three possible cases (time for a case by case analysis!):
(Perfect square, perfect cube) = ( 1 , 8 ) , ( 4 , 8 ) , ( 1 6 , 2 7 )
Note: We try to fit all the numbers first in these cases, the arrangement will be decided later
Case 1 : ( 1 6 , 2 7 )
To get a 1 6 , our only possible option is 7 + 9 . Our number will then be
□ □ □ □ 7 9 □ □ □ □
The two digits beside 7 and 9 will need to add up to 1 1 . We have these possibilities: 5 + 6 , 3 + 8
First, we try 5 and 6
□ □ □ 5 7 9 6 □ □ □
We are left with 0 , 1 , 2 , 3 , 4 , 8 . To satisfy clues 3, 4 and 5, 8 must go with 4 to get a difference of 4 . 3 must then go with 0 to get a difference of 3 , but that leaves us with 2 and 1 . We cannot satisfy clues 3, 4 and 5, so this option is impossible.
We then try 3 and 8 :
□ □ □ 3 7 9 8 □ □ □
We are left with 0 , 1 , 2 , 4 , 5 , 6 . To satisfy clue 5, we have 3 options:
This implies that Case 1 is impossible. We then move on to the next case
Case 2 : ( 4 , 8 )
To get a sum of 4 , we have only two options: 4 + 0 , 3 + 1
Note that to get an 8 , we have to get 4 + 4 . This implies that 4 , 0 , 3 , 1 are all in the center, and we have only two possibilities. Let's try out the first one:
□ □ □ 4 1 3 0 □ □ □
We are left with 2 , 5 , 6 , 7 , 8 , 9 . To satisfy clues 3, 4 and 5, 2 must go with 5 or 6 . If 2 goes with 5 , the remaining digits 6 , 7 , 8 , 9 cannot satisfy clue 5. If 2 goes with 6 to satisfy clue 5, 5 and 8 will satisfy clue 4, and 7 and 9 will satisfy clue 3. We then have
7 5 2 4 1 3 0 6 8 9
Next, we check to see if it satisfies clues 6 and 7.
Note that adding 5 distinct digits will give a minimum of 10 and a maximum of 35. The triangular numbers between 10 and 35 inclusive are 1 0 , 1 5 , 2 1 , 2 8 . The sum of all 1 0 digits is 4 5 , and these are the possible combinations:
( 1 0 , 3 5 ) , ( 1 5 , 3 0 ) , ( 2 1 , 2 4 ) , ( 2 8 , 1 7 )
Among these possible combinations, only ( 2 8 , 1 7 ) satisfies clues 6 and 7.
Now, we return to our number:
7 5 2 4 1 3 0 6 8 9
The sum of the first 5 digits is 1 9 . We cannot move 4 as it needs to satisfy clue 9. The other digits in the first half are all the smaller digits, therefore we know that we cannot satisfy clues 6 and 7 with this combination.
Note that the second possibility:
□ □ □ 1 4 0 3 □ □ □
will also lead to the same dead end as above. We can then be certain that Case 3 is the only possible option
Case 3 : ( 1 , 8 )
The two middle numbers must be 0 and 1 :
□ □ □ □ 0 1 □ □ □ □
To get an 8 , the two digits beside 0 and 1 must add up to 7 . We have two possibilities: 4 + 3 , 2 + 5
Note that the first possibility
□ □ □ 4 0 1 3 □ □ □
will lead to the same dead end we got in Case 2. This implies that the only option we have is
□ □ □ 2 0 1 5 □ □ □
We are now left with 3 , 4 , 6 , 7 , 8 , 9 . To satisfy clue 5, we have 2 options:
Put it in the number:
7 3 4 2 0 1 5 8 6 9
Now, we check and see if it satisfies clues 6 and 7 :
From case 2, we know that the first 5 digits must add up to 1 7 , and the last 5 digits must add up to 2 8
The first 5 digits add up to 1 6 , and we have only one way to change this to 1 7 : switch the middle numbers
7 3 4 2 1 0 5 8 6 9
4 is in the first half, and clue 9 is satisfied. We are left with clue 8:
Sum of digits in odd positions = 7 + 4 + 1 + 5 + 6 = 2 3 . The sum is an odd number, which satisfies the final clue.
Punch in the code 7 3 4 2 1 0 5 8 6 9 , and run towards your freedom!
The sum of the digits 0 − 9 is 4 5 . The only combination of Prime and Triangular numbers that works is 1 7 and 2 8 .
One of the first five numerals is 4 . So the sum of the other four digits is 1 3 .
The only possible combos for first five and last five digits is--
4 9 0 1 3 , 2 5 6 7 8 ,
4 8 0 2 3 , 1 5 6 7 9 ,
4 7 0 1 5 , 2 3 6 8 9 ,
4 7 1 2 3 , 0 5 6 8 9 ,
4 6 0 2 5 , 1 3 7 8 9 .
It is extremely unlikely that 9 is in the first five digits.
The Cube number can only be 8 or 2 7 and the square number can be 1 , 4 , 9 , 1 6 .
Combining the information about difference between digits as provided and sum of odd positions being odd, the only Code that works is 7 3 4 2 1 0 5 8 6 9
Just want to ask if clue 8 is really necessary, because all other possibilities have been eliminated before there is even a chance to use it.
Problem Loading...
Note Loading...
Set Loading...
Throughout this solution I will use the notation (a,b,c) with any number of elements within parentheses to represent all possible permutations of those numbers
Starting with the same method as Satyen:
( 0 , 1 , 3 , 4 , 9 ) ( 2 , 5 , 6 , 7 , 8 ) ,
( 0 , 2 , 3 , 4 , 8 ) ( 1 , 5 , 6 , 7 , 9 ) ,
( 0 , 1 , 4 , 5 , 7 ) ( 2 , 3 , 6 , 8 , 9 ) ,
( 1 , 2 , 3 , 4 , 7 ) ( 0 , 5 , 6 , 8 , 9 ) ,
( 0 , 2 , 4 , 5 , 6 ) ( 1 , 3 , 7 , 8 , 9 )
The square number can be 1 , 4 , 9 , 1 6 however, if it is 9 then adding the next two digits will not make it big enough to be the next cube 2 7 so 9 is out, the square must be 1 , 4 , 1 6 and the cube will be 8 if the square is 1 , 4 and 2 7 if the square is 1 6 .
Take the last case ( 0 , 2 , 4 , 5 , 6 ) ( 1 , 3 , 7 , 8 , 9 ) :
The only possible square is 1 so the cube is 8 and we have ( 2 , 5 , 6 ) 4 0 1 3 ( 7 , 8 , 9 ) . Clues 3 , 4 and 5 tell us that each number on the left must be 2 , 3 or 4 away from a number on the right, 2 on the left is not, we have a contradiction and this entire case is thrown out.
Note that if the square is 4 then we have either 0 , 4 or 1 , 3 in the middle and as the cube must be 8 , we use the digits 0 , 1 , 3 and 4 in the 4 middle spots. For each case left, 3 of these digits are part of the left most 5 and so the square can't be 4 . For similar reasons, if the square is made of 0 and 1 , then the cube must add either 2 and 5 or 3 and 4 but we just established that in the remaining cases 0 , 1 , 3 , 4 cannot be in the middle in any order. This means the three possible combinations of middle 4 digits are 0 , 1 , 2 , 5 if the square is 1 and 7 , 9 , 3 , 8 or 7 , 9 , 5 , 6 if the square is 1 6
In the first case we must have ( 0 , 1 , 4 ) 3 9 7 8 ( 2 , 5 , 6 ) , the only two that are 4 apart are 1 and 5 so we have ( 0 , 4 ) 3 9 7 8 ( 2 , 6 ) but now none are 3 apart so this case is out
Case 2 we have ( 3 , 4 , 8 ) 2 0 1 5 ( 6 , 7 , 9 ) the only two that are 4 apart are 3 and 7 so we have ( 4 , 8 ) 3 2 0 1 5 7 ( 6 , 9 ) but now none are 3 apart so this case is also out
Taking case 3 ( 0 , 1 , 4 ) 5 7 9 6 ( 2 , 3 , 8 ) the only two that are 4 apart are 4 and 8 so we have ( 0 , 1 ) 4 5 7 9 6 8 ( 2 , 3 ) however choosing the only digits 3 apart, 0 and 3 for the next digits out, leaves us with digits only 1 aprat when they must be 2 .
We now know the number must have the form ( 1 , 2 , 3 , 4 , 7 ) ( 0 , 5 , 6 , 8 , 9 ) giving two options:
( 1 , 2 , 4 ) 3 7 9 8 ( 0 , 5 , 6 ) → ( 1 , 4 ) 2 3 7 9 8 6 ( 0 , 5 ) because if we choose 1 , 5 as the two digits 4 apart we have only even digits left, none of which could have difference 3 , however even with the case chosen, no pairs have difference 3 so this subcase is out.
( 3 , 4 , 7 ) 2 1 0 5 ( 6 , 8 , 9 ) → ( 3 , 7 ) 4 2 1 0 5 8 ( 6 , 9 ) → 7 3 4 2 1 0 5 8 6 9
Adding up the odd digits of 7 3 4 2 1 0 5 8 6 9 we have 7 + 4 + 1 + 5 + 6 = 2 3 which is odd so the answer is 7 3 4 2 1 0 5 8 6 9
Drowning in the casework for this solution, if there is a way to limit it please lemme know!