TITLE: Why is Euclid's proof on the infinitude of primes considered a proof?
QUESTION [69 upvotes]: I've expressed Euclid's proof on the infinitude of primes on Mathematica:
f[x_] := Product[Prime[n], {n, 1, x}] + 1
TableForm[Table[{f[x], PrimeQ[f[x]]}, {x, 1, 20}]]

Which results in:
$\begin{array}{ll}
 3 & \text{True} \\
 7 & \text{True} \\
 31 & \text{True} \\
 211 & \text{True} \\
 2311 & \text{True} \\
 30031 & \text{False} \\
 510511 & \text{False} \\
 9699691 & \text{False} \\
 223092871 & \text{False} \\
 6469693231 & \text{False} \\
 200560490131 & \text{True} \\
 7420738134811 & \text{False} \\
 304250263527211 & \text{False} \\
 13082761331670031 & \text{False} \\
 614889782588491411 & \text{False} \\
 32589158477190044731 & \text{False} \\
 1922760350154212639071 & \text{False} \\
 117288381359406970983271 & \text{False} \\
 7858321551080267055879091 & \text{False} \\
 557940830126698960967415391 & \text{False} \\
\end{array}$
The proof flaws for all those values, how is it considered a proof then? I guess that there might be infinite prime numbers according to the proof, but what is the guarantee that at some point it won't fail indefinitely?

REPLY [4 votes]: There is an older post from 2011 that you should check out: Is there an intuitionist (i.e., constructive) proof of the infinitude of primes?.
Also you should have a look at a proof (attributed to Filip Saidak) that runs as follows:
Let $n \gt 1$ be a positive integer.  Since $n$ and $n+1$ are consecutive integers, they must be coprime, and hence the number $n_2 = n(n + 1)$ must have at least two different prime factors. Similarly, the integers $n(n+1)$ and $n(n+1)+1$ are consecutive, therefore coprime, hence the number $n_3 = n(n + 1)(n(n + 1) + 1)$ must have at least three different prime factors. Now continue this process indefinitely.