-1

How would I calculate the following without using a calculator: $152615278636986567767^{12345678}$ % $5$

I have gotten only the last digit by doing: $152615278636986567767$ % $10 = 7$

Therefore having $7^{12345678}$ % $5$.

I am unsure of how I should do the rest to find the final remainder.

I had a look at similar formats like How would I find the modulo of a large number without using a calculator that supports large numbers?, but I haven't learned any of the following rules/theorems.

  • I'd be curious how you think you could do this with a calculator! – fleablood Mar 19 '20 at 15:34
  • 1
    You haven't learned about "Little Fermat" yet? Then, for this question at least, it's time to do it. – Dietrich Burde Mar 19 '20 at 15:35
  • Not sure if it has a different name, but nothing seems to appear on my coursebook similar to "Little Fermat". Is this the only way to solve this kind of questions? @DietrichBurde – user430574 Mar 19 '20 at 15:37
  • You may be able to spot the pattern yourself, by quickly finding the remainders modulo 5 of $7,7^2, 7^3,7^4,\ldots $. – hardmath Mar 19 '20 at 15:38
  • Certainly you should know this, it is very basic. Have a look at wikipedia. – Dietrich Burde Mar 19 '20 at 15:39
  • 1
    What do you mean with % 5? – Bernard Mar 19 '20 at 15:40
  • 1
    '%' is a common way of writing 'modulo' (or more strictly 'remainder') in lots of programming languages. – JonathanZ Mar 19 '20 at 15:52
  • Often $%5$ is an operation which will "spit out" a number between $0$ and $4$. So $243% 5 = 3$ says that $243% 5$ IS the number $3$. $\mod 5$ on the other hand isn't an operation that gives an output but says something about how two numbers are related. $243\equiv 3\pmod 5$ isn't a number; its a statment that $243$ and $3$ have the same remainder. Now with $\mod 5$ then statement $243\equiv 68\equiv 3\pmod 5$ is true but $243% 5 = 68$ is not. But $243%5= 68%5$ is. This can be annoying when trying to state "the remainder of the sum is the sum of the remainders". – fleablood Mar 19 '20 at 21:57

2 Answers2

2

I'm assuming you don't know Fermat's little theorem yet. So I won't tell you to use it.

But $7^1\% 5 = 2$.

And $7^2\% 2=2*7\% 5=14\% 4 = 4$

And $7^3\% 3 = 4*7\%5 = 28\% 5 = 3$

and $7^4\%4 = 3*7\%5 = 12\% 5 = 1$ and hey we're back to one!.

$7^5\%4 = 1*7\%5=7\% 5 = 2$. We're back where we started.

So we going to repeat and repeat in $4$ term cylce.

The eggponent is $12345678=12345676 + 2$ which goes through a bunch of four term cycles and two more. So $7^{12345678}\% 5 = 7^2 \% = 4$.

.....

Oh.... I guess I'm assuming it is intuitively obvious that if $a\% 5 = m$ and $b\% 5= n$ then $ab \% 5 = mn\% 5$......

I'll leave that to you to convince yourself it is clear.

Knowing this three things:

  1. $(a+b)\% N = [(a\%N)+(b\% N)]\%N$
  2. $(a\times b)\%N = [(a\%N)\times (b\%N)]\% N$
  3. Theres only $5$ possible remainders (including $0$) so eventually these powers will repeat.

You should be able to solve this on your own.

fleablood
  • 124,253
  • for this calculation $7^2% 2=27% 5=14% 4 = 4$, how did $2$ come up and followed by $2 7$? Also for $7^3% 4$ and $7^4% 3$? – user430574 Mar 20 '20 at 04:04
  • $7%5 = 2$ so $7^2%5 = 77%5 = 72%5=14%4 =4$. And $7^3%=7^27% 5 = 47%5=28%5 = 3$. Also because $7%5 = 2$ we can replace all the $7$s with $2$s. $7^3 %5= 2^3%5=8\5 5 = 3$. – fleablood Mar 20 '20 at 05:07
  • Sorry, not quite getting the $7^4%5$ part. – user430574 Mar 20 '20 at 05:22
  • $7^4%5 =7(7^3)%5 = 7(7(7^2))%5 = 7(7(77)))%5= 7(7(72))%5=7(7(14))%5 = 7(74)%5 = 7(28)%=73% = 21% = 1$. So $7^{12345678}%5=7^{12345676}7^2%5=(7^4)^{3086419}7^2%5= (7^4%5)^{3086419}7^2%5=1^{3086419}7^2%5=1*7^2%5=7^2%5$. – fleablood Mar 20 '20 at 05:32
0

As $152615278636986567767\equiv 7\mod 10$, we also have $152615278636986567767\equiv 7\equiv 2\mod 5$.

Now by lil' Fermat, as $2$ and $5$ are coprime, we have $2^4\equiv 1\mod 5$, so that $$152615278636986567767^{12345678}\equiv 2^{12345678}\equiv 2^{12345678\bmod4}=2^2\mod 5.$$

Bernard
  • 175,478
  • THis is fine. But the OP clearly hasn't learned Little Fermat yet (or even the notation of $7\equiv 2 \pmod 5$). – fleablood Mar 19 '20 at 20:27
  • Litle Fermat anyway isn't a problem, as it's about the powers og $2$ modulo $5$, but if he/she doesn't know the notion of modular arithmetic… – Bernard Mar 19 '20 at 20:48