# ${\underbrace{a\dots a}_\text{$2n$}}^{\overbrace{b\dots b}^{2n}}+{\underbrace{b\dots b}_{2n}}^{\overbrace{a\dots a}^{2n}} \equiv 0 \mod (a+b)$? [closed]

Is this valid for all cases? $${\underbrace{aaa\dots a}_\text{2n times}}^{\overbrace{bbb\dots b}^\text{2n times}}+{\underbrace{bbb\dots b}_\text{2n times}}^{\overbrace{aaa\dots a}^\text{2n times}} \equiv 0 \mod (a+b)$$

For example, this holds in case of $$2222^{5555}+5555^{2222}$$, which is divisible by $$7$$, however I'm getting confused on how to prove it through congruence.

Any ideas or hints?

• You tagged "contest-math". Hope this is not an ongoing contest ! – Peter May 8 at 8:54
• Oh not at all. It's actually a practice question in my book. Sorry for the ambiguity. – user907745 May 8 at 9:03
• $$22^{33}+33^{22}\equiv 2^1+3^2\equiv2+4\equiv 1\pmod 5$$ – miracle173 May 8 at 9:12
• I rolled back you question to your initial question Please do not change your question because this invalidates my answer. If you have another question then pose a new one. – miracle173 May 8 at 19:03
• @Crease You say that this is a practice problem from a book. Which book? – Xander Henderson May 8 at 19:41

We have \begin{align} 2222^{5555}+5555^{2222}&\equiv3^{5\times1111}+4^{2\times1111}&&\pmod7\\ &\equiv243^{1111}+16^{1111}&&\pmod7\\ &\equiv(-2)^{1111}+2^{1111}&&\pmod7\\ &\equiv0&&\pmod7 \end{align} You can also see this for similar such thing.

That is wrong!

$$22^{33}+33^{22}\equiv 2^1+3^2\equiv2+4\equiv 1\pmod 5$$

• apologies, I don't quite understand this answer; I'm sure I'm missing something, but how does it address the question? – Atticus Stonestrom May 8 at 14:02
• @AtticusStonestrom the OP changed the question after I answered it. In the meantime I rolled it back – miracle173 May 8 at 19:06
• ah, thank you, that makes much more sense! (+1) – Atticus Stonestrom May 8 at 21:45

By Fermat's little theorem, we reduce the exponents $$\pmod6$$.

We use CRT via Bezout, and we have $$5555\equiv1\pmod2$$ and $$5555\equiv2\pmod3$$. So $$5555\equiv5\pmod6$$, since $$(-1)2+(1)3=1\implies 5555\equiv -2\cdot2+3\cdot1\equiv5\pmod6$$.

Next $$2222\equiv0\pmod2$$ and $$2222\equiv2\pmod3$$ so $$2222\equiv2\pmod6$$.

Thus $$5555^{2222}+2222^{5555}\equiv4^2+3^5\equiv 16+243\equiv259\equiv0\pmod7$$, using what you got.