How to prove Lucas's Converse of Fermat's Little Theorem without using primitive root? 
Problem:
  If $x^{n-1} \equiv 1 \pmod{n}$, and for all divisors $q$ of $n - 1$, $a^{q} \not\equiv 1 \pmod{n}$, then $n$ is prime. $(n > 1)$

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,  
 A: Hint $ $ The hypotheses imply the order $\,k\,$ of $\,x\,$ is a divisor of $\,n-1\,$ but not a proper divisor, so $\, k = n-1.\, $  By here and Euler, $\,n-1\mid  \phi(n)\ $ so $\ n-1\, \le\, \phi(n).\, $ This implies  $\,n\,$ is prime, by$\ \phi(n) \,\le\, n-\color{red}{2}\ $ for composite $\,n,\,$  by at least $\color{red}2\,$ smaller naturals $1<n\!-\!1$ are noncoprime to $\,n$.
Optimization $ $ We can we can restrict to maximal proper divisors $\,q\,$ using the following.
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.
Remark $ $ This is frequently called the Lucas Primality Test.
A: Do you understand the definition of $\phi(n)$?  It's the number of natural numbers less than $n$ which are relatively prime to $n$. If $n$ is prime, then $\phi(n)$ is necessarily $n-1$ (since only 1 is relatively prime with $n$).  Likewise, if $\phi(n) = n-1$ then only one number less than $n$ is relatively prime to it, which must be the number 1, so $n$ is prime.  So that would be the relationship between them.
