Find $7^{2018}-1 \bmod 5$ using Fermat's Little Theorem

122 Views Asked by At

Let $z=7^{2018}-1$

Theorem. : Let $p \in \mathbb{N}$ be any prime and $a \in \mathbb{Z}$. If $p$ doesn't divide $a$, then $p$ divides $a^{p-1}-1$

$$ z=\left(7^{1009}\right)^2-1=\left(7^{1009}\right)^{3-1}-1 $$ For $p=3$ and $a=7^{1009}$ the theorem gives: $$ z \bmod 3=0 $$ Any hints on how to proceed to find $z \bmod 5$?


Note: Some kind of error occurred and the important part of the last sentence got deleted/never composed. I apologize for the ambiguity of my question in its previous form.

3

There are 3 best solutions below

0
On BEST ANSWER

Any hints on how to proceed to find zmod5?

Do it the EXACT same way.

$5 -1 = X$

And $2018\div X = Q$ with $R$ remaider.

So $7^{2018}-1 = (7^{Q})^X*7^R - 1 \equiv 7^R - 1 \pmod 5$.

Figuring $7^R-1$ can be done by hand as $7\equiv 2\pmod 5$ so $7^R\equiv 2^R\pmod 7$ and $R < 5$.

.....

But I do have advice: Don't to $7^{2018} - 1 = (7^{2018})^2 - 1 \equiv 1-1 \equiv 0 \pmod 3$. Do $7^{2018} -1 = (7^2)^{2018} - 1 \equiv 1^{2018} - 1\equiv 0 \pmod 3$. It'll make things easier when $2018\div (p-1)$ has a remainder (as it does with $p = 5$)

3
On

We have: $$(7^2)^{1009} - 1 \pmod 5$$ $$\equiv (-1)^{1009} - 1$$ $$\equiv -2 \equiv \bbox[5px,border:2px solid black]3 \pmod 5$$

0
On

$7^{5-1}≡1\mod 5$$7^{2016}=(7^4)^{504} ≡1\mod 5$

$7^2=49 ≡-1\mod 5$

$7^{2}.7^{2016}=7^{2018} ≡-1\mod 5$

$2^{2018}-1≡-2\mod 5 ≡3\mod 5$