# Find $x \in{Z_{250}}$ so that $x\equiv{248^{156,454,638}} \pmod{250}$?

I am looking for a easy way to solve it, without use the computer. I did that but with the computer.

$GCD(250,248) \ne 1$

So I did: $250 = 125*2$

$248^{156454638}$ (mod 250) = $248^{156454638}$ (mod 125) + $248^{156454638}$(mod 2)

We know that: 248 (mod 2) = $0$ and $248^{156454638}$ (mod 2) also is $0$

so, We reduce our expresion to:

$248^{156454638}$ (mod 125) with $GCD(248,125) = 1$

Now I can use Euler:

$\varphi(125) = 100$

So I will try to reduce the big exponent:

$156,454,638 = 260,757 * 100 * 2 * 4 + 438$

and then:

$248^{156,454,638}$ (mod 125) = $248^{260,757*600}$ * $248^{438}$ (mod 125)

$248^{260,757*600}$ (mod 125) = $1$

$248^{438}$ (mod 125) = 69

using the computer I got 194, but I can't resolve it using just my calculator, can someone help me to find a easy way to do it? there a way to process number with big exponent?

• This might be useful: How do I compute $a^b\,\bmod c$ by hand? – Martin Sleziak Jan 18 '16 at 17:23
• @MartinSleziak I was seeing that method but you can see that $(156,454,638)_{10} = (1001010100110100111011101110)_2$ So i have a loop of 29 lines – Raul Benitez Jan 18 '16 at 17:29

As $248\equiv-2\pmod{250}$

$248^{156454638}\equiv(-2)^{156454638}\equiv2^{156454638}$

As $(2,250)=2$ let us find $2^{156454638-1}\pmod{125}$

As $(2,125)=1$ and $\phi(125)=100,156454638-1\equiv37\pmod{100}$

$2^{156454638-1}\equiv2^{37}\pmod{125}$

Now $2^7\equiv3,2^{37}=2^2\cdot(2^7)^5\equiv2^2\cdot3^5\equiv-28\equiv97\pmod{125}$

$2\cdot2^{156454638-1}\equiv2\cdot97\pmod{2\cdot125}\equiv?$

• thats is the answer, ending the exercise we will 194 – Raul Benitez Jan 18 '16 at 16:58
• @RaulBenitez, That is $$194\equiv69\pmod{125}$$ Btw, have u found the method simpler? – lab bhattacharjee Jan 18 '16 at 17:00
• yeah I founded it,. It is more easy to calculate – Raul Benitez Jan 18 '16 at 17:13

You got that $248^{156,454,638} \equiv 69 \mod 125$ which is correct.

But as you wanted $248^{156,454,638} \equiv 69 \mod 250$ this isn't nescessarily the final answer.

Either $248^{156,454,638} \equiv 69 \mod 250$

or $248^{156,454,638} \equiv 69 + 125 \equiv 194 \mod 250$[*]

So as $\gcd(248, 250) = 2$ we know the final answer must also be even.

So $194$ is the answer.

Worth noting, as the other answer did (and I didn't), that $248 \equiv -2 \mod 250$ so ...

=======

[*][So $248^{156,454,638} = 69 + m*125$ so $248^{156,454,638} = 194 + (m-1)*125$

So $248^{156,454,638} = 69 + (m/2)*250$ if $m$ is even.

Or $248^{156,454,638} = 194 + ((m-1)/2)*250$ if $m$ is odd.]