# Use Mersenne numbers to prove that there are infinitely many prime numbers. [duplicate]

When reading the book Mersenne Numbers and Fermat Numbers, after proving that: for any positive integers m,n, it holds $$\gcd(M_n,M_m)=1$$ if and only if $$\gcd(m,n)=1$$, it says that this allows us to give one more proof of the infiniteness of the set of prime numbers:

Here is the proof: Consider the set $$\{M_2, M_3,\cdots, M_{p_n},\cdots\}$$,of all Mersenne numbers with prime indexes $$p_1=2, p_2=3$$, $$\cdots$$. For each $$M_{p_i}$$, denoted by $$q_i$$ the smallest prime divisor of $$M_{p_i}$$. In this way, we get a set $$\{q_1,q_2, \cdots, q_i, \cdots\}$$ of prime numbers: $$q_1=3, q_2=7$$, etc.

For $$i\ne j$$, it holds $$p_i \ne p_j$$, and hence $$\gcd(p_i,p_j)=1$$; so $$\gcd(M_{p_i},M_{p_j})=1$$, and $$q_i\ne q_j$$. Therefore, all elements of the set $$\{q_1,q_2, \cdots, q_i, \cdots\}$$ are different. If the set P of primes of finite say, $$P=\{p_1,p_2,\cdots, p_k\}$$, it should coincide with the set $$\{q_1,q_2, \cdots, q_k\}$$. But $$p_1=2$$, while all numbers $$q_i$$ are odd; a contradiction. It proves that the set P of primes is infinite.

I don't quite understand the sentence in bold (why P should coincide with the set containing $$q_i$$). Can anyone help me?

• Well, more simply: consider the $M_p$ for all primes $p$. These are relatively prime so the least prime dividing each gives us an infinite list of primes.
– lulu
Commented Jun 6, 2023 at 14:37

If $$P$$ were the set of all primes and were assumed to be finite $$P =: \{p_1, \dots, p_k\}$$, then it would have to contain $$\{q_1,\dots, q_k\}$$, since they are prime numbers, but all the $$q_i$$s are different per what has been said, thus we would have equality of cardinals between $$\{p_1,\dots, p_k\}$$ and $$\{q_1,\dots,q_k\}$$ with an inclusion, thus we would have equality of the sets.