5

I attempting to solve $x^{55} \equiv 33 \pmod{257}$. In using Fermat's Little Theorem and the observation that $1 = 55 \cdot (-121) + 256\cdot 26,$ I get \begin{align*} x^{55} \equiv 33 \pmod{257} &\Rightarrow x^{55 \cdot (-121)} \equiv 33^{-121} \pmod{257} \\ & \Rightarrow x (x^{256})^{-26} \equiv 33^{-121} \pmod{257} \\ &\Rightarrow x \equiv 33^{-121} \pmod{257} . \end{align*}

However, I must still compute $33^{-1} \pmod{257}$ by solving \begin{align} 33x \equiv 1 \pmod{257}, \tag{1} \end{align} with which I am having difficulty without a calculator. In using WolframAlpha, I have obtained $x \equiv 148 \pmod{257}$ and so must compute \begin{align} 148^{121} \pmod{257}, \tag{2} \end{align}with which I am again having difficulty evaluating. Are there any tips to compute these last two steps $(1)$ and $(2)$?

J. W. Tanner
  • 60,406
  • Are you looking for a solution which is doable by hand? Or can you use a calculator for something like computing the first several powers of $33$ – pancini Feb 12 '24 at 05:54
  • Even elementarily (sure, let's say that's a word), we have $33 \cdot 8 \equiv 7 \pmod{257}, 7 \cdot 37 \equiv 2 \pmod{257}, 2 \cdot 129 \equiv 1 \pmod{257}$, so we're looking for $8 \cdot 37 \cdot 129 \bmod 257$, which we can fairly quickly compute. – Brian Tung Feb 12 '24 at 05:59
  • By Fermat, $33^{256}\equiv 1\pmod{257}$, so $33^{-121}\equiv 33^{256-121}=33^{135}$, so it remains to simplify $33^{135}\pmod{257}$. I can't yet find a slick way to do this by hand. – pancini Feb 12 '24 at 06:28

1 Answers1

2

I will write a solution that is doable by hand, though a tad computational.

We can use the Extended Euclidean Algorithm to compute modular inverses. We have \begin{align*} 257 &= 33 \times 7 + 26 && & 1 &= 5 \times 1 - 2 \times 2\\ 33 &= 26 \times 1 + 7 && && = 5 \times 3 - 7 \times 2\\ 26 &= 7 \times 3 + 5 && \implies && = 26 \times 3 - 7 \times 11\\ 7 &= 5 \times 1 + 2 && && = 26 \times 14 - 33 \times 11\\ 5 &= 2 \times 2 + 1 && && = 257 \times 14 - 33 \times 109 \end{align*} Hence, $33 \times 109 \equiv -1 \pmod{257}$, so $33^{-1} \equiv 148 \pmod{257}$.

Now, we wish to evaluate $148^{121} \pmod{257}$. Using repeated squares, we have \begin{align*} 148^2 \equiv (-109)^2 \equiv 11881 &\equiv 59 \pmod{257}\\ 148^3 \equiv -6431 &\equiv -6 \pmod{257}\\ 148^6 &\equiv 36 \pmod{257}\\ 148^{12} \equiv 1296 &\equiv 11 \pmod{257}\\ 148^{15} &\equiv -66 \pmod{257}\\ 148^{30} \equiv 4356 &\equiv -13 \pmod{257}\\ 148^{60} &\equiv 169 \pmod{257}\\ 148^{120} \equiv (-88)^2 \equiv 7744 &\equiv 34 \pmod{257}\\ 148^{121} \equiv -3706 &\equiv 149 \pmod{257} \end{align*} Hence, $x \equiv 149 \pmod{257}$.

Sharky Kesa
  • 4,137