IIRC, that is actually the standard proof that there are infinitely many primes[1] or maybe this variation on it[2].
[1]: https://en.wikipedia.org/wiki/Euclid%27s_theorem#Euclid's_pr...
[2]: https://en.wikipedia.org/wiki/Euclid%27s_theorem#Proof_using...