Rex and Ralph: Mystery Number
Math brain teasers require computations to solve.
Two mathematicians, Rex and Ralph, have an ongoing competition to stump each other. Ralph was impressed by the ingenuity of Rex's last attempt using clues involving prime numbers, but he thinks he's got an even better one for Rex. He tells Rex he's thinking of a 6digit number.
"All of the digits are different. The digital sum matches the number formed by the last two digits in the number. The sum of the first two digits is the same as the sum of the last two digits."
"Take the sum of the number, the number rotated one to the left, the number rotated one to the right, the number with the first three and last three digits swapped, the number with the digit pairs rotated to the left, and the number with the digit pairs rotated to the right. The first and last digits of this sum match the last two digits of the number, in some order."
Ralph then asks, "If each of the three numbers formed by the digit pairs in the number is prime, then what is the number?"
Rex looks confused, and for a moment Ralph thinks he's finally gotten him. Then Rex smiles, scribbles a few things down on a pad of paper and then says, "Very nice, Ralph!"
Rex then tells Ralph his number.
What did Rex say?
(See the hint for an explanation of the terminology.)
HintThe digital sum is the sum of the digits in the number. The digital sum of 247 is 2+4+7 = 13.
The digit pairs in 125690 are 12 56 90. These are also the numbers formed by the digit pairs.
Rotating 123456 one to the left gives 234561;
Rotating 123456 one to the right gives 612345;
Rotating the digit pairs in 567890 to the left gives 789056;
Rotating the digit pairs in 567890 to the right gives 905678.
Hide
Answer
416723
Here's how Rex determined Ralph's number:
The insight Rex needed to solve this involves the number produced by the sum of the six numbers created from configurations of the digits in the number. Assign ABCDEF to the digits in Ralph's number. The six numbers Ralph had Rex add together were:
ABCDEF
BCDEFA
FABCDE
DEFABC
CDEFAB
EFABCD
Notice that the six digits in each column in this summation are the six digits in the number. This means that the sum of each column will be the digital sum of the number. If that digital sum is represented by A+B+C+D+E+F = XY, then the problem is equivalent to adding:
XXXXXX0
+YYYYYY
The first and last digits will be X and Y only if 10 > X + Y. If X + Y is greater than 9, then the first digit will be X+1. Since both the digital sum of the number (A+B+C+D+E+F) and the first and last digit of the sum of the numbers match the digits XY, you know that 10 > X + Y. When Rex realized this relation he smiled because he knew that he had enough information now.
The digital sum of the number must be between 0+1+2+3+4+5 = 15 and 9+8+7+6+5+4 = 39. Since each of the digit pairs in the number form a prime number, the digital sum must be a prime number in this range. There are only six prime numbers in this range: 17, 19, 23, 29, 31, and 37. 19, 29 and 37 are eliminated since 1+9 > 9, 2+9 > 9 and 3+7 > 9.
The sum of the first two digits must match the sum of the last two digits (X+Y). For 31, 3+1=4, but the only other way to make four without repeating any digits is 0+4. Zero and four can't form a prime number, so the digital sum can't be 31. This leaves 17 and 23.
For the digital sum to be 17, the digits must be either 0+1+2+3+4+7 = 17 or 0+1+2+3+5+6 = 17. Only 0, 1, 2, 3, 4, 7 has both a 1 and 7 to make the last two digits be 17. However, there is no pair of remaining digits with a sum of 1+7 = 8, so the digital sum can't be 17 and therefore must be 23.
If the last two digits are 23, then the first two digits must total 2+3 = 5. The possibilities are 0+5 = 5 and 1+4 = 5. There is one prime number possible with each of these pairs: 05 and 41. The first two digits of the number can't be 05 because then the number would be a 5digit number and Ralph's number has six digits. So the first two digits are 41 and the last two digits are 23.
Since the sum of all the digits is 23, then the sum of the middle two digits must be 23  (2+3)  (4+1) = 13. There are two pairs of the remaining digits that total 13: 5+8 = 13, and 6+7 = 13. Sixtyseven is the only prime number that can be formed from these pairs, so the middle two digits are 67 and Ralph's number is 416723.
Hide
Comments
HellCold
Feb 05, 2009
 Excellent one. Really great... 
precious1026
Feb 07, 2009
 Did your really think someone could follow that train of thought without a paycheck? I usually like all teasers, but this one was off the hook. But once I saw your train of thought and looked at the six digit number, which you led people to believe, the six digit number could have been any sic digits. I love Braingle. and you too. Good Teaser, boring but good, I hope you are truly good in math? You are not lying to us? 
javaguru
Feb 07, 2009
 I think the train of thought in the teaser was easier to follow than your comment...did you have a point? 
sfun3
Feb 08, 2009
 loved this one as well! Excellent thinking! 
ronhoward
Feb 08, 2009
 Wow. The train of thought ran right over me!
This seemed to be impossible at first, at least impossible to have a unique solution. It was amazing how as I worked on it the choices kept narrowing down. I thought this one was actually quite a bit easier than your Polygonal House teaser, probably because I got the "aha!" quicker on this one.
Another incredible teaser! Keep 'em coming!
How do you come up with these? 
javaguru
Feb 08, 2009
 Thank you ron for the comment and complement!
When creating a teaser, first I try to find some interesting principle or quirk of math, probability or logic to exploit. Then I play around with different ideas using it until I find one I like. Then I try to (at least in the case of the Rex and Ralph teasers) determine what the minimum set of information will allow the solution to be determined. After I've worked out the math, at some point I get around to creating the teaser. I have about a dozen teasers right now where I've completed the math aspect, but just haven't had time to write a pleasing teaser around the math. In a few cases the teaser is written, but I haven't been able to simplify the explanation as much as I'd like.
I guess the main other "secret" to writing a good teaser is to be your own harshest critic. I discard most of my ideas and keep some around for a quite a while because they just don't feel right.
I know there's a large portion of the population on Braingle that won't ever appreciate my teasers because they require real effort, but I'm OK with that. I like them. 
sfun3
Feb 09, 2009
 Can't wait for the next one.
I can only really deeply appreciate all the thought going into those puzzles. I can solve them, but it is sooo much harder to come up with a good puzzle and construct an interesting story around it.
And don't worry about the community, there are enough of us loving these kind of puzzles. 
shooter800
Apr 28, 2009
 great work , but that suppose to have one solution i think it have more than one lets see
145823
that number is prime and all of your conditions approved 
shooter800
Apr 28, 2009
 sorry u wrote "If each of the three numbers formed by the digit pairs in the number is prime, then what is the number?"
but i read each ( any) great puzzle thank u 
bigpat
May 08, 2009
 Great puzzle. I solved the puzzle slightly differnetly than the given solution. I assumed (and wrongly) that zero wasn't one of the answers. Turns out I still got the right answer and after a little thinking I figured out that my method would have still eliminated zero so its all good 
Lightspeed
May 08, 2009
 I think this is the best puzzle where you have to figure out the number from clues about the digits. I love how at first it doesn't seem like there is enough information to arrive at a unique answer. I played around with the sum of the six numbers for a little bit before recognizing that each column in the sum contained the same set of digits. The Aha! moment was great!
Brilliant puzzle! 
rlc327
Jul 19, 2010
 I got 314113 (we'll call that number x)
digital sum (aka sum of digits or SOD) = last 2 digits : 13 = 13
SOD 1st 2 = SOD last 2 : 4 = 4
x rotated "a lot : 1444443
1st and last of "x rotated a lot" = last 2 digits of x : 13 = 13
Prime number digit pairs : 31, 41, and 13. 
rlc327
Jul 19, 2010
 continuation of above:
but the teaser was GREAT. i'd love to see more of these! 
javaguru
Jul 19, 2010
 ric: Your answer doesn't meet the criteria "all digits are different". 
eighsse
Sep 24, 2013
 This was an excellent one!
I seriously almost got it, but I came up with 430,217, and I thought I had it so I stopped looking. But I was overlooking that one little clue  the sum of the first two digits is equal to the sum of the last two digits! 
Back to Top
 
