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$?
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$?
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.
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.
P.S. I hate the "#" not "$" TeX error.
– Rio Alvarado Aug 11 '15 at 06:35