# Find ABC given that the other five possible permutations of its digits add up to 3194

I was going through Terence Tao's solving mathematical problems,A Personal Perspective . I was trying to solve the following problem which is exercise 2.1 on pg. 13, in the chapter Examples in Number Theory . The problem is:In a parlor game, the magician asks one of the participants to think of a three digit number ABC. Then the magician asks the participant to add the five numbers ACB,BAC,BCA,CAB and CBA. Suppose the sum is 3194. What is the original ABC? I have got the following:

$$122A+221C+212B=3194$$

$A,B,C$ must be one of $\{0,1,2,3,4,5,6,7,8,9\}$.

$C$must be even.

I tried to follow the hint-using modular arithmetic to get some bounds on $A,B,C$. I tried placing bounds by using modulus 3 and got $A+B+C\cong(mod 3)$. So two of them have to be $0,3,6,$ or $9$ and the other must be $1,4,$ or $7$. Should I continue with hit and trial method here on or can I place more bounds and simplify the problem and how ?

• Are you sure you have the problem correctly? The left side is at least 5550, which is a good deal greater than the right side? Commented May 14, 2016 at 0:20
• Suppose you added up all six permutations of the three digits (giving something more than $3194$ of course). How would your expression of the total relate to $a,b,c$ then? Working from that "upper bound" I got the answer very quickly. Commented May 14, 2016 at 0:22
• @martycohen I believe (but am not sure) that the OP means $122\times a+\cdots$ etc. It is not clear at all, and I agree the title suggests your reading.
– lulu
Commented May 14, 2016 at 0:23
• @Gayatri Can you clarify? Does $122a$ mean "$a+2\times 10+2\times 100+1\times 1000$" or does it mean $122\times a$?
– lulu
Commented May 14, 2016 at 0:25
• I would make that explicit in the question (as you can see, many people read it differently). Trial and error solves your problem very quickly, though the method sketched by @hardmath is very elegant.
– lulu
Commented May 14, 2016 at 0:41

## 2 Answers

Suppose we try all six permutations of the three (unknown) digits, so that adding them up contributes:

$222 \times (A+B+C)$

Now this will exceed $3194$ by the value of (digit represented value) ABC, so we can begin by guessing the multiple:

$\lceil 3194/222 \rceil$

That one doesn't work out properly, but the next multiple does.

ABC = $358$ and $3194 + 358 = 222 \times (3+5+8)$

I stumbled into the answer... but I can at least tell you what I was thinking.

Because c has to be even I thought, it would be better to not start there.

maximize b.b=9

212*9 = 1908

What is the smallest value c can be?

If a,b= 9

122*9+212*9=3006.

c is at least 2.

If c is 2 and b is 9, then the largest a can be without going over is 6

122*6+221*2+212*9 = 3082 = (3194-122) not that useful

Lets try c= 4

122*3+221*4+212*9 = 3158 = (3194-36) Now I am somewhere, because

(221-212) = 9, If I increase c by 4 and reduce b by 4 we will be on target.

122*3+221*8+212*5 = 3194

• Your final line seems to have a typo(?) if we compare to $122A+221C+212B=3194$ in the Question. You started with "b has to be even", but actually it is $C$ that must be even. Maybe there is some confusion about the place-value representation ABC? Commented May 14, 2016 at 13:01
• Can you please explain the last statement ? Why ,if 221-212=9,if we increase c by 4 and reduce b by 4 we will be on target? Commented May 14, 2016 at 18:30