I was asked to solve the following sum:


What I managed to found is that 111A + 111B + 111C + 111D = 1000A + 100B + 10C + D which rearranged becomes:

889A - 11B - 101C - 110D = 0

Also that A + B + C = 10 or 20

If A + B + C = 10 --> C = D + 1
If A + B + C = 20 --> C = D + 2

Here after trying all the combination of C and D and plugging them into the 2 equations above to solve for A and B. I managed to found that the only solution that gives integer values is (I'll masked it in case anyone wants to solve it on their own):

222 + 999 + 999 + 777 = 2997

My friend is insisting that 2 letters cannot be equals. Is something in my reasoning wrong? Is there another solution or this is the only solution?

  • 1
    $\begingroup$ A quick brute-force search only found yours and 0 as a valid solution (assuming A, B C and D are 1 digit from 0 to 9 and that we are working in base 10). $\endgroup$
    – FrodCube
    Commented Oct 23, 2016 at 13:18
  • $\begingroup$ Your friend is trolling you. As already described, there is no answer for A,B,C,D all different. $\endgroup$
    – Sid
    Commented Oct 23, 2016 at 15:27
  • $\begingroup$ Related: ABCDE = the sum of all of its 3-letter permutations (ABC + ABD + ABE + BAC + BAD + …). Also necessarily involves a multiple of 111. $\endgroup$
    – smci
    Commented Oct 24, 2016 at 3:42

3 Answers 3


The answer is:

There is no solution with $A, B, C, D$ all different and $A \neq 0$.


As you noted $AAA+BBB+CCC+DDD=111(A+B+C+D)$. In particular, ABCD must be a multiple of 111. Since $A \neq 0$, ABCD is more than $9 \cdot 111 = 999$ but less than $31 \cdot 111 = 3441$ since $A+B+C+D \leq 9+8+7+6 = 30$. So ABCD equals $k \cdot 111$ for a two-digit number $k\leq 30$, so it equals $(10m+n)111 = m\cdot 1000 + (m+n) \cdot 100 + (m+n) \cdot 10 + n \cdot 1$. Because the middle two digits are not equal, we must have $m+n\geq10$ (so that it carries). If $m=1$, $n=9$, then ABCD equals 2109, so $A+B+C+D= 12\neq 10m+n=19$. If $m=2$, $n=8$, then ABCD equals 3108, so $A+B+C+D= 12\neq 10m+n=28$. If $m=2$, $n=9$, then ABCD equals 3219, so $A+B+C+D= 15\neq 10m+n=29$. Also, $m\leq2$ because $k\leq 30$ and $m=3, n=0$ is clearly not possible.


The answer is

There is no solution


We allow letters to be equal

This includes

With zeros and with leading zeros

I can't add a full explanation now, but brute force confirms this.

Others feel free to add your own answer with an explanation


Maybe your friend is being a little tricky - since

this wont work in any integer base using (the normal) non-negative digits

How about

using (not normal!) negative digits?

For example in base ten with:
1) $A=-1,B=0,C=1,D=-9$ or
2) $A=2,B=-1,C=9,D=8$
(other integer bases greater than $3$ will also have such "solutions")




Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.