0
$\begingroup$

$x = (5^2 \bmod 6)^4 \bmod 15$.

I wanted to turn $(5^2 \bmod 6)^4 \bmod 15$ into a constant, but I just lost hope when I saw how humongous the expression was.

  • 0
    @internetlearning you should start thinking about accepting answers you find helpful.2012-11-30

2 Answers 2

13

$\begin{eqnarray} && (5^2 \bmod 6)^4 \bmod 15 \\ &=& (25 \bmod 6)^4 \bmod 15 \\ &=& (19 \bmod 6)^4 \bmod 15 \\ &=& (13 \bmod 6)^4 \bmod 15 \\ &=& (7 \bmod 6)^4 \bmod 15 \\ &=& (1 \bmod 6)^4 \bmod 15 \\ &=& 1^4 \bmod 15 \\ &=& 1 \bmod 15 \\ &=& 1 \end{eqnarray}$

  • 3
    @internetlearning, by the way I would have actually done $5^2 = (-1)^2 \mod 6$ but I thought it's simpler this way when you are just learning about mod.2012-11-29
1

You can actually just directly compute $5^2 = 25$.

Now we have $(25 \bmod 6)^4 \bmod 15 = 1^4 \bmod 15 = 1 \bmod 15$