0

I'm not too sure how I would go about solving $2017^{2017}$ mod $13$.

Bérénice
  • 9,487
  • 2
  • See also: https://math.stackexchange.com/questions/1606780/modular-arithmetic-problem-mod-13 – lab bhattacharjee Apr 29 '17 at 02:26
  • You can reduce the problem in two ways to a smaller one. First observe that $2017 \pmod {13} = 2$, so that $2017^{a} \pmod {13} = (13 * x +2 )^{2017} \pmod {13}$, which is just $2^{2017} \pmod {13}$ because the remaining terms in the expansion are multiples of $13$. Second, observe that $2^b \pmod {13}$ produces all the numbers $1,2,\ldots,12$ as $b$ takes values $1,2,\ldots,$ and is periodic with period $12$. Since $2017 \pmod {12} = 1$, we have that $2^{2017} \pmod {13} = 2^1 \pmod {13} = 2$. – Ashwin Ganesan Apr 29 '17 at 03:45
  • If you generalize the second method in my previous comment, you get Fermat's little theorem. If $p$ is a prime, then the set of integers ${1,2,\ldots,p-1}$ forms a group under multiplication $\pmod p$. Hence, every element in this group has order $p-1$. This implies that $k^{p-1}$ is the identity group element for each $k=1,2,\ldots,p-1$, This gives Fermat's little theorem that $k^{p-1} \equiv 1 \pmod p$ for each positive integer $k$. This means $k^b \pmod p$ generates the numbers $1,\ldots,p-1$ in some order as $b$ takes values $1,2,\ldots$ and this sequence is periodic, period $p-1$. – Ashwin Ganesan Apr 29 '17 at 03:51
  • If you find any answer useful, please accept the best answer See : How does accepting an answer work? – Jaideep Khare May 04 '17 at 17:26

2 Answers2

5

For these type of questions, always use Fermat's Little Theorem :

$$a^{p-1} \equiv 1\pmod p $$

Where $p$ is a prime number and $\gcd(a,p)=1$

Here $p=13$ and $a=2017$

Therefore :

$$2017^{12}\equiv 1\pmod {13} \implies \left(2017^{12}\right)^{168}\equiv 1^{168}\pmod {13} $$

Hence :

$$2017^{2016} \equiv 1\pmod {13}$$

Multiplying $2017$ both the sides :

$$2017^{2017} \equiv 2017 \pmod {13} \equiv 2 \pmod{13}$$

Jaideep Khare
  • 19,551
4

Note that $2017 \equiv 2\pmod {13} $. And using Fermat's Little Theorem we have:

$$2^{12} \equiv 1\pmod {13} $$

Hence,

$$2017^{2017} \equiv 2^{2017} \equiv 2 \cdot (2^{12})^{168} \equiv 2 \cdot 1 = 2 \pmod {13} $$

Ramil
  • 1,938