For what values of $n$ , does $7 \mid 5^n+1$

77 Views Asked by At

$7 \mid 5^n+1$ implies $5^n+1=7a$ for some integer $a$

i.e $5^n=7a-1$

Now , $5^n$ is an integer which always ends with $5$ [for any integer $n$].

Thus , $7a-1$ must also end with $5$.But , this is only possible when , $a$ is an integer ending with $8$ as, $7 \times 8=56$ and $6-1=5$. But , for all digits ending with $8$ say $8$ itself , $5^n$ does not exist.

So , how to solve this sum ? Please help me .

Thank you.

2

There are 2 best solutions below

1
On BEST ANSWER

$5^n\equiv 1,5,4,-1,2,3,1\pmod{\! 7}$ for $n=0,1,2,3,4,5,6$, respectively.

This pattern continues and $\, 5^n\equiv -1\iff n\equiv 3\, $ mod $6$.

More rigorously: $3$ is the least nonnegative $c$ giving $5^c\equiv -1\pmod{\! 7}$.

Let $n=3+k$ with $k\ge 0$. We'll show $5^n\equiv -1\pmod{\! 7}$ iff $k=6m$ for some $m\ge 0$.

$5^{n}\equiv 5^{3+k}\equiv -5^{k}\equiv -1\pmod{\! 7}\iff 5^k\equiv 1\pmod{\! 7}$.

This is true iff $k=(\text{ord}_7 5)m=6m$ for some $m\ge 0$.

0
On

$5$ is a generator modulo $7$.

More generally, given a generator $g$ modulo $m$ (which admits exactly $\varphi(\varphi(m))$ generators) hence the solutions of $g^x \equiv -1 \pmod{m}$ is given by $$ x\equiv \frac{\varphi(m)}{2} \pmod{\varphi(m)}. $$

Notice that twe are not even assuming that $m$ is prime. Indeed $m$ admits at least one generator if and only if $m \in \{2,4,p^k,2p^k\}$ for some prime $p$ and positive integer $k$.