I am stuck on proving a lot of the theorems that are discussed in number theory. Most of the theorems that I've seen in number theory so far are the ones I've already been shown how to prove, but I don't get the general approach for finding out how to prove them.
Let's say, for instance, we want to prove that there are infinitely many prime numbers. I know the basic methods of proving statements like direct proofs, proof by contradiction etc., so we could suppose that there are finitely many primes $p_1, p_2, \cdots,p_k$ with $p_1 < p_2 <\cdots < p_k$ by contradiction. Then in the next step of the proof, a new integer n is defined as $n = p_1\cdot p_2\cdot\space\cdots\space\cdot p_k + 1$, and because it is greater than $p_k$, it is composite since we assumed that there are finitely many primes. But the thing I don't get though is how $n = p_1\cdot p_2\cdot\space\cdots\space\cdot p_k + 1$ just came up so randomly.
I understand that continuing the proof eventually leads to the contradiction that 1 is composite, but the trouble is I don't know where to start just in general.
For example, if I wanted to prove that there are infinitely many primes of the form $6\cdot k + 5$ for some integer k, where would I start? I've tried doing something like defining $n = (6k_1 + 5)(6k_2 + 5)\cdots +(6k_r+5) + 5$ for $r$ primes of the form since I'm assuming that n could be a new prime of the form maybe (not too sure), but from there, nothing seems to be working out and I cannot get a contradiction in any way. And even if I did want to get a contradiction, how would I know what will end up being the contradiction in the end?
Is anybody able to help me with this? Thank you in advance.
First, the contradiction in the proof of infinitely many prime numbers is that this number $n=p_1p_2\dots p_k+1$ should be a multiple of a prime (fundamental theorem of artithmetic tells you that any number can be expressed as a product of primes), but by this construction, you can see that $n$ is not a multiple of any of these prime numbers (because when you divide $n$ by any of these prime numbers $p_i$ it gives you the residue $1$) which leads a contradiction. So, it is not random, the $n$ was constructed so that $n$ is not divisible by any of these prime numbers. Now, about primes of the form 6k+5 there may be methods similar to the above, but you may check Dirichlet's theorem of prime numbers in arithmetic progressions which is way more general https://en.wikipedia.org/wiki/Dirichlet%27s_theorem_on_arithmetic_progressions The techniques to prove this are not elementary, instead it uses analytic properties of the L -functions associated to characters.
PS: So, for the case 6m+5: Note that besides 2,3 the primes are of the form 6m+1 or 6m+5. Assume by contradiction that $p_1,p_2,\dots, p_k$ are all the primes of the form 6m+5. Then, define $n=(2)(3)(p_1p_2\dots p_k)-1=6p_1\dots p_k-1$. The idea is that the primes $2,3,p_1,\dots,p_k$ do not divide $n$. Hence, the only primes that divide $n$ should be of the form $6m+1$, but if this were the case, then $n=(6m_1+1)(6m_2+1)\dots(6m_r+1)=6M+1$, so $n\equiv 1\mod (6)$, but this is a contradiction since by construction $n=6p_1\dots p_k-1\equiv -1\mod (6)$