Question: Consider the congruence $x^n =2($mod $13)$. Then for which n does it have a solution?

1. n= 5
2. n=6
3. n=7
4. n=8

Can we take any help from this fact $x^{12 }=1 ($ mod $13),\forall x $?

Please give some hints.

Answer: 
As $\displaystyle2^2\equiv4;2^3\equiv8;2^4=16\equiv3;2^6=64\equiv-1\pmod{13}$

$\displaystyle2$ is itself a primitive root $\pmod{13}$

Taking discrete logarithm wrt $2\pmod{13}$ on $\displaystyle x^n\equiv2\pmod{13}$

$\displaystyle n\cdot\text{ind}\_2x\equiv1\pmod{12}\implies (n,12)=1$

Using [Bézout's Lemma](https://proofwiki.org/wiki/B%C3%A9zout%27s_Lemma), we can always find integer $\text{ind}\_2x$ for $(n,12)=1$
As you know from the theorem, $x^{p-1} = 1 (mod p)$ so if you want to get number 2 you can use $x^{p-1}+1 = 2 (mod p)$

 It's one kind of solution. Now you can extend $x^{p-1}+1$ type numbers.