0

Is $2^n-1$ always a prime for odd values of $n$? $n\not=1$ Taking some odd values of $n$, I observed outcome is coming as a prime number. How to verify it?

Or at-least, is $2^n-1$ always coprime to $n$?

  • 1
    $2^9-1$ is not prime. In fact $2^n-1$ is never prime if $n$ is odd and composite. – André Nicolas Aug 11 '15 at 06:30
  • @rational your question seems similar to this one, it might give you ideas http://math.stackexchange.com/questions/140804/if-2n1-is-prime-why-must-n-be-a-power-of-2 – iadvd Aug 11 '15 at 06:33
  • 3
    You might want to look into what are called Mersenne Primes for some interesting further reading.

    P.S. I hate the "#" not "$" TeX error.

    – Rio Alvarado Aug 11 '15 at 06:35

2 Answers2

4

No. For example:

$2^{21}-1=7^2 \cdot 127 \cdot 337$

It is neither prime nor coprime to 21 (has the common factor of 7).

In fact, for any odd prime number $p$, if the order of $2$ to the modulus $p$ is odd, then one can easily find a number $k$ such that $p \mid2^k-1$ and $p \mid k$. If $m$ is the order of $2$ to the modulus $p$ (i.e. $m$ is the smallest positive integer such that $2^m \equiv 1 \pmod{p}$), and $m$ is odd, then $2^{mp} \equiv \left(2^m\right)^p \equiv 1 \pmod{p}$, so $p \mid 2^{mp}-1$. Clearly $p \mid mp$, so the choice of $k=mp$ works.

ASKASK
  • 9,000
  • 4
  • 28
  • 49
3

No. $2^9-1$ is not prime. In fact a composite exponent yields a composite number, in this case. Indeed interesting are primes $p$ of the form $2^q-1$, where $q$ is also prime. These are called Mersenne primes, and the first counterexample to the claim " $2^q-1$ is always prime" is $q=11$. Nonetheless, they are conjectured to be infinite.