0

From Euler's Theorem, I know that $2^{32} \equiv 1 \pmod{51}$, since $\varphi(51) = 32$. But, is there a way to efficiently calculate the lowest power of $2$, so that it is still congruent to $1 \pmod {51}$? (I'm aware that it's $2^8$, by trial and error, I just don't understand the connection and efficient way to do this).

Ebrin
  • 637
  • 2
    Use the Chinese remainder theorem. $2^2\equiv 1 \pmod 3$ and $2^8\equiv 1 \pmod {17}$ (both by inspection). – lulu Oct 28 '19 at 20:07

2 Answers2

3

The efficient way uses the Chinese remainder theorem: it is the smallest exponent $n$ such that $n$ such that $2^n\equiv 1$ both $\bmod 3$ and $\bmod 17$, i.e. the l.c.m. of the smallest $n$s working mod. $3$ and mod. $17$.

For $3$ the answer is obvious : it is $n=2$. For $17$, it is a divisor of $16$, i.e. a power of $2$. Now $2^4\equiv -1\bmod 17$, so the corresponding $n$ is indeed $8$.

Bernard
  • 175,478
1

Hint $\bmod 17\!:\ 2^4\equiv \color{}{-1\not\equiv 1}\,$ so $\ 2^8\equiv 1,\,$ so $\,2\,$ has order $\,\color{}8\,$ by the Order Test.

Further $\bmod 3\!:\ 2^2\equiv 1\,\Longrightarrow\, 2^8\equiv 1\,$

Thus $\,3,17\mid 2^8-1\,\Rightarrow\, 51=3(17)\mid 2^8-1,\,$ so $\,2\,$ has order $8 \pmod {\!51}\ $ (it can't be $n<8$ else $2^n \equiv 1$ would also hold $\bmod 17$ contra above)

Remark $ $ Generally we can show $\,o_{mn}(a) = {\rm lcm} (o_m(a),o_n(a)),\,$ $\,o_n(a):= {\rm ord}(a)\pmod{\! n}\ $ for coprime $\,m,n,\,$ by using $\,\mathbb Z/mn\, \cong\, \mathbb Z/m \times \mathbb Z/n\,$ by CRT.

Bill Dubuque
  • 272,048
  • The order test link links back to this answer, and did you mean $1\color{red}7$ where you wrote $16$? – J. W. Tanner Oct 28 '19 at 21:52
  • 1
    @J.W.T Typos fixed, thanks! – Bill Dubuque Oct 28 '19 at 22:09
  • Thanks for your reply Bill, you've been very helpful. I just started learning Number Theory and I'm still having trouble understanding few concepts. I wonder, how would you approach this problem if instead of composite, the modulo was prime? E.g. 53 instead of 51? – Ebrin Oct 29 '19 at 11:15
  • To clarify, given 2 to the power 52 is congruent to 1 mod 53, can we find lower power of n such that it's still congruent to 1 mod 53? Or does Fermat's little theorem give lowest such power? Thanks in advance. (Sorry for formatting, I'm on the phone) – Ebrin Oct 29 '19 at 11:21
  • @Elving If the modulus is a prime $p$ then by little Fermat we know that $,a^{p-1}\equiv 1\pmod{p},$ if $,p\nmid a,,$ by Fermat. So, as in the linked proof of the Order Test, we know that the order $,n,$ of $,a,$ is a divisor of $,p-1,,$ which we can find it by removing as many prime factors from $p-1$ as possible till we obtain the minimal $n$ such that $,a^n\equiv 1\pmod{!p}\ \ \ $ – Bill Dubuque Oct 29 '19 at 14:18
  • @Ebrin For efficient algorithms for order computation see this answer. – Bill Dubuque Oct 29 '19 at 14:23