1

Find a b such that:

$4^b \mod 107 = 34$

My first thought is to use F.L.T.

$$4^{106} \mod 107 \equiv 1 \mod 107$$ $$34*(4^{106}) \mod 107$$

but seems a little unnessicary...

Any thoughts on where to go from here?

Bill Dubuque
  • 272,048

2 Answers2

3

This is an instance of the difficult discrete logarithm problem, but it is small enough that it is amenable to hand computation.

Algorithmically let's use Shanks' baby giant step. By below $2$ is a primitive root $({\rm ord}\,2 = \color{darkorange}{106})$ so $\,34 \equiv 2^{\large n},\,$ and we seek $\,34\cdot 2^{\large -11j}\equiv 2^{\large k}$ for $\,0\le j,k < 11 = \lceil \sqrt{\color{darkorange}{106}}\:\!\rceil,\,$ by repeatedly scaling $\,34\,$ by $\,2^{\large -11}\!\equiv \color{#0a0}{50}\,$ (by Remark) till we reach some $\,2^{\large k}\equiv 1,\color{}2,4,8,16,32,64,21,\color{#c00}{42},84,\color{#90f}{61},\,$ i.e.

$$34 \overset{\large \times\color{#0a0}{50}}\to 95\overset{\large\times\color{#0a0}{50}}\to \color{#c00}{42\equiv 2^{\large 8}}\qquad $$

so $\ \smash[t]{34(\overbrace{2^{\large -11}}^{\large \color{#0a0}{50}})^{\Large\color{}2}}\equiv \color{#c00}{2^{\large 8}}\overset{\large \times\, 2^{\LARGE 22}\!}\Longrightarrow 34\equiv 2^{\large 30}\!\equiv 2^{\large 2b}\!\!\!\iff$ $\! 2b\equiv 30\pmod{\!\color{darkorange}{106}}\!\!\iff\! \bbox[5px,border:1px solid #c00]{b\equiv 15\pmod{\!53}}$

Remark $ \bmod 107\!:\,\ 2^{\large 11}\! \equiv 2(\color{#90f}{61})\equiv 15\ $ so applying Gauss's algorithm

$$2^{\large -11}\equiv \dfrac{1}{15}\equiv \dfrac{7}{105}\equiv \dfrac{-100}{-2}\equiv \color{#0a0}{50}$$

To prove $\,{\rm ord}\,2 = \color{darkorange}{106},\,$ by the Order Test it suffices to show that $\,2^{\large 106/p}\!\not\equiv 1$ for all primes $\,p\mid 106,\,$ i.e. $\,2^{\large 2}\!\not\equiv 1,\, $ $2^{\large 53}\!\not\equiv 1,\,$ which is true.

Bill Dubuque
  • 272,048
0

tedious ( and potentially error prone, corrected before posting) way :

$$4^{b-1}\equiv 62\implies 4^{b-2}\equiv -38\implies 4^{b-3}\equiv 44\implies 4^{b-4}\equiv -96$$$$\implies 4^{b-5}\equiv -24\implies 4^{b-6}\equiv -6\implies 4^{b-7}\equiv 52\implies 4^{b-8}\equiv -94$$$$\implies 4^{b-9}\equiv 30 \implies 4^{b-10}\equiv -46\implies 4^{b-11}\equiv 42\implies 4^{b-12}\equiv 64$$$$\implies 4^{b-13}\equiv 16\implies 4^{b-14}\equiv 4\implies 4^{b-15}\equiv 1\pmod {107}$$

This is based on the following.

  • if $c$ is odd, turn into $-(107-c)$

  • if $c$ is $4k+2$ , divide by 2 before doing the previous step, and divide by 2 again.

  • if $c$ is $4j$ divide by 4 .

    Fermat isn't looking so bad anymore. With a little knowledge, like $2^{2b}\equiv 4^b$ restricting $b$, or knowing you can modular sqrt 34; and figure the results discrete log for base 2, it's not so bad. tedious sure, bad, unnecessary, yes, but useful.

  • of course, looking at $y=mx+b$ form allows you to show it's a 2 mod 4 multiple of 107 forcing $b$ to over 4 in 2 steps. –  Nov 22 '19 at 16:38
  • 105060 is the lcm of all the primes dividing the differences and that could push b>9 for example. –  Nov 22 '19 at 18:51