Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If $n \geq 1$ is not prime and $x \in\mathbb{Z}_n$ such that $\gcd(x, n) \neq 1$, prove that $x^{n-1} \bmod n \not\equiv 1$.

I am not sure why this would be true. So, letting $n$ be a nonprime and $x$ being in $\mathbb{Z}_n$, and with $\gcd(x, n)\neq 1$, both $x$ and $n$ share some common factor. I need to relate this to $x^{n-1}$ having a non-$1$ remainder when divided by $n$, but I don't see any apparent connection that makes this so.

I would really appreciate guidance or clarity, but would not like the problem fully solved for me.

share|cite|improve this question
To get subscripts, use the underline, so a_n gives $a_n$. To get multicharacter exponents, enclose them in braces, so x^{(n-1)} gives $x^{(n-1)}$. This works everywhere you need to treat a number of characters as one. Finally, for mod n! use \pmod {n!} and for gcd use \gcd to get $\pmod {n!}$ and $\gcd$ – Ross Millikan Mar 5 '13 at 1:53
Welcome to math.SE. You can find some good starting points on how to format mathematics on the site here. This AMS reference is very useful. If you need to format more advanced things, there are many excellent references on LaTeX on the internet, including StackExchange's own TeX.SE site. – Zev Chonoles Mar 5 '13 at 1:53
Thank you both for the help and info on formatting! – samxx Mar 5 '13 at 2:02

Hint $\rm\,\ d\mid x,\,\ d\mid n\mid x^{n-1}\!-\!1\:\Rightarrow\:d\mid 1$

share|cite|improve this answer

Let $d$ be the common factor. Show $d$ is also a factor of $x^{n-1}$. Deduce that $x^{n-1}\not\equiv1\pmod n$.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.