Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What will be the ones digit of the remainder in: $$\frac{\left|5555^{2222} + 2222^{5555}\right|} {7}$$

share|cite|improve this question
What have you tried? What do you know? Does Modulo Arithmetic sound familiar? How about Euler's Theorem? – Calvin Lin Jan 15 '13 at 16:01
I tried it like 5555...will occur 2222 times, and 5555/7 gives remainder = 4. So 4 will occur 555 times. That's what i thought and similar way for 2222. – Ravi Jan 15 '13 at 16:04
It's somewhat confusing - the remainder when dividing by $7$ is already always a one-digit number, so do you mean the ones-digit of the quotient, or do you really mean the ones-digit of the remainder? Specifically, if someone asked "what is the one's digit of the remainder in $$\frac{99}{7}$$ what do you think the answer is supposed to be? – Thomas Andrews Jan 15 '13 at 16:23
Its the one's digit of remainder only. I ain't getting how to procede in such a question.. – Ravi Jan 15 '13 at 16:24
Well the answer is 0. – Ravi Jan 15 '13 at 16:25
up vote 8 down vote accepted

Hint: $ 5555 \equiv 4 \pmod{7}$, $2222 \equiv 3 \pmod{7}$.

Edit: Calculate that $4^3 \equiv 1, 3^6 \equiv 1 \pmod{7}$. Hence, this implies that $4^{3k} \equiv (4^3)^k \equiv 1^k \equiv 1 \pmod{7}, 3^{6j} \equiv (3^6)^j \equiv 1^j \equiv \pmod{7}$.

Now, $2222 \equiv 2 \pmod{3}$, and $5555 \equiv 5 \pmod{6}$. Hence,

$$ 5555^{2222} + 2222^{5555} \equiv 4^{2222} + 3^{5555} \equiv 4^ 2 + 3^ 5 \pmod{7}.$$

share|cite|improve this answer
Hmm..the answer is 0 but by doing 269/7 it comes out 2. – Ravi Jan 15 '13 at 16:08
@Ravi Please check your arithmetic again. – Calvin Lin Jan 15 '13 at 16:10
Actually when you divide 5555 by 7 then 4 occurs 557 times, and when you divide 2222 by 7 then 3 occurs 1853 times. But that doesn't help either. – Ravi Jan 15 '13 at 16:17
And i don't think we have to apply Euler 's theorem here. By the way , if we ignore the mod function then can you tell how to procede? – Ravi Jan 15 '13 at 16:18
@Ravi When I said to check your arithmetic, I meant $4^2 + 3^5 \neq 269$. You'd have to apply something to reduce the powers from 2222/5555 to some much more manageable. It need not be Euler's theorem, but that's a fast guaranteed approach. You may look at $2^3, 5^3 \pmod{7}$ and decide that's sufficient. – Calvin Lin Jan 15 '13 at 16:26

This is not a solution. I was trying to find out the possible values of $n$ such that $${\underbrace{22\cdots22}_{n\text{ digits }}}^{\underbrace{55\cdots55}_{n\text{ digits }}}+{\underbrace{55\cdots55}_{n\text{ digits }}}^{\underbrace{22\cdots22}_{n\text{ digits }}}$$ is divisible by $7$.

Let $$\underbrace{11\cdots11}_{n\text{ digits }} =\frac{10^n-1}9=M$$

Clearly $M$ is odd.

Now, $$(2M)^{5M}+(5M)^{2M}\equiv (2M)^{5M}+(-2M)^{2M}\pmod 7\equiv (2M)^{5M}+(2M)^{2M}=(2M)^{2M}\{(2M)^{3M}+1\}$$ which will be divisible by $7$

if (i) $7\mid \{(2M)^{3M}+1\}\iff 7\mid \{M^{3M}+1\}$ as $2^3\equiv1$

$\iff 7\mid \{\left(\frac{10^n-1}9\right)^{3M}+1\}\iff 7\mid \{(10^n-1)^{3M}+1\}$ as $9^3=3^6\equiv1\pmod 7$

So, we need $(10^n-1)^{3M}\equiv-1\pmod 7\implies (10^n-1)^3\equiv-1$ as $3M\equiv3\pmod {\phi(7)}$ as $M$ is odd.

Taking Discrete Logarithm wrt a primitive root $3\mod 7,$

$3\cdot ind_3(10^n-1)\equiv 3\pmod 6=6c+3$ for some integer $c$

So, $$ ind_3(10^n-1)=2c+1$$

So, $10^n-1\equiv 3^{2c+1}\pmod 7\equiv 3,6,5\iff 10^n\equiv4,6,7\pmod7$

$10^n\not\equiv7\pmod 7$ as $(10,7)=1$

$10^1\equiv3,10^2\equiv3^3\equiv2,10^3\equiv2\cdot10\equiv6,10^4\equiv2^2=4,10^5\equiv2\cdot6\equiv5,10^6\equiv 6^2\equiv1\pmod 7$

So, $n\equiv3,4\pmod 6$

or if (ii)$7\mid (2M)^{2M}\iff 7\mid M^{2M}\implies 7\mid M\implies 10^n\equiv1\pmod 7\iff 6\mid n$

So, if $n\equiv0,3,4\pmod 6,$ $${\underbrace{22\cdots22}_{n\text{ digits }}}^{\underbrace{55\cdots55}_{n\text{ digits }}}+{\underbrace{55\cdots55}_{n\text{ digits }}}^{\underbrace{22\cdots22}_{n\text{ digits }}}$$ is divisible by $7$.

share|cite|improve this answer
This is not a comment. This is just a tribute. – im so confused Jan 15 '13 at 20:22

in this question i would use remainder theorem since 5555 and 2222 are positive integers the expression is positive so we have find remainder of expression (5555^2222+22222^5555) when divided by 7 5555 divided by 7 leaves remainder 4 2222 diided by 7 leaves remiander 3 remainder will be of for 4^2222+ 3^5555 so expression can be written as 16^ 1111+ 243^ 1111 is always divisible by 7

share|cite|improve this answer
Here's a MathJax tutorial :) – Shaun Oct 3 '14 at 13:13

${\rm mod}\ 7\!:\ 4^{2222}\!+(-4)^{5555} \equiv 4^{2222}(1-4^{3333})\equiv 4^{2222}(1-(\color{#c00}{2^6})^{1111})\equiv 0\,$ by $\,\color{#c00}{2^6\equiv 1}$

${\rm mod}\ 7\!:\ \ \ a^{k}+\ (-a)^{k+3n} \ \equiv\ \,a^k\, (1\,-\,a^{3n})\ \ \equiv\ \ a^k\, (1\,-\,(\color{#c00}{b^6})^{n})\equiv 0\,$ by $\ \color{#c00}{b^6\equiv 1}\,$ if $\,0\not\equiv a\equiv b^2$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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