# Does AAA+BBB+CCC+DDD=ABCD have a solution for distinct digits A,B,C,D?

I was asked to solve the following sum:

AAA
BBB
CCC
DDD
--------
ABCD

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?

• 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). – FrodCube Oct 23 '16 at 13:18
• Your friend is trolling you. As already described, there is no answer for A,B,C,D all different. – Sid Oct 23 '16 at 15:27
• Related: ABCDE = the sum of all of its 3-letter permutations (ABC + ABD + ABE + BAC + BAD + …). Also necessarily involves a multiple of 111. – smci Oct 24 '16 at 3:42

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

Because:

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.

There is no solution

Unless

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.

Maybe your friend is being a little tricky - since

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

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")

1)
$AAA=-100-10-1=-111$
$BBB=0+0+0=0$
$CCC=100+10+1=111$
$DDD=-900-90-9=-999$
$AAA+BBB+CCC+DDD=-999$
$ABCD=-1000+0+10-9=-999$

2)
$AAA=200+20+2=222$
$BBB=-100-10-1=-111$
$CCC=900+90+9=999$
$DDD=800+80+8=888$
$AAA+BBB+CCC+DDD=1998$
$ABCD=2000-100+90+8=1998$