2

Problem:
If $n > 1$, and there exists an integer $x$ such that $x^{n-1} \equiv 1 \pmod{n}$, but $x^{q} \not\equiv 1 \pmod{n}$ for all strict divisors $q$ of $n - 1$, then $n$ is prime.

I read the proof in the book and it was very straightforward; however, I wonder is there a way to prove it by just using congruence property?

And another related question about power residue:
If we have $a^{n - 1} \equiv 1 \pmod{n}$. Is there any relation between $n - 1$ and $\phi(n)$? Because I thought of $a^{\phi(n)} \equiv 1 \pmod{n}$, when $(a, n) = 1$. I try to think of away to connect these two ideas, but I still cannot see it.
Any idea?

Thanks,

roxrook
  • 12,399

1 Answers1

1

The hypotheses imply the order $\,k\,$ of $\,x\pmod{\! n}\,$ is a divisor of $\,n\!-\!1,\,$ but not a proper divisor, so $\, k = n\!-\!1.\, $ These $\,n\!-\!\color{#c00}{\bf 1}$ incongruent powers of $\:\!x\:\!$ are all invertible $(x^kx^{n-1-k}\equiv 1)\,$ hence coprime to $\:\!n,\,$ so $\:\!n\:\!$ is prime (a composite $\:\!n\!=\!ab\,$ has at most $\,n\!-\!\color{#c00}{\bf 2}\,$ coprimes - it omits $\,\color{#c00}{0,\:\!a}$).


Optimization $ $ Lucas Primality Test. We need only test maximal proper divisors $\,q=n/p\,$ by

Order Test $\ \,a\,$ has order $\,n\iff a^n \equiv 1\,$ but $\,a^{n/p} \not\equiv 1\,$ for every prime $\,p\mid n.\,$

Proof $\ (\Leftarrow)\ $ If $\,a\,$ has $\,\color{#c00}{{\rm order}\ k}\,$ then $\,k\mid n\,$ (proof). If $\:k < n\,$ then $\,k\,$ is proper divisor of $\,n\,$ therefore $\,k\,$ arises by deleting at least one prime $\,p\,$ from the prime factorization of $\,n,\,$ hence $\,k\mid n/p,\,$ say $\, kj = n/p,\ $ so $\ a^{n/p} \equiv (\color{#c00}{a^k})^j\equiv \color{#c00}1^j\equiv 1,\,$ contra hypothesis. $\ (\Rightarrow)\ $ Clear.

Bill Dubuque
  • 282,220
  • When you say order $k$ of $x$, do you mean $ord_{k}x$? – roxrook Mar 10 '11 at 06:44
  • @Chan: $\rm\ mod\ n::\ k\ $ is the order of $\rm\ x:,\ $ so $\rm\ x^j\equiv 1\ \iff\ k\ |\ j:$ – Bill Dubuque Mar 10 '11 at 06:47
  • Thanks, sorry my mathematics vocabulary are very limited. I tried to understand your hint, but I was confused because the argument that you used is very similar to the way the book proved using primitive root. – roxrook Mar 10 '11 at 06:51
  • @Chan: What book? – Bill Dubuque Mar 10 '11 at 06:54
  • I'm currently reading "Elementary Number Theory and Its application" by Kenneth H. Rosen 6th edition. Thanks. – roxrook Mar 10 '11 at 07:07
  • 1
    Great! The subgroup of $(\mathbb{Z}/n)^{\times}$ generated by $a$ has cardinality $n-1$, so the group itself has at least $n-1$ elements. Therefore $n$ is prime ( no need for Euler here I guess). – orangeskid Sep 04 '22 at 01:01
  • @ora Like many ENT textbooks, OP's textbook (Rosen, cf. above comment) uses no group theory so I avoided it. Yes, we can also eliminate explicit use of Euler totient too - as I did in an edit. – Bill Dubuque May 22 '25 at 09:25