Question about prime numbers - How many prime factors greater than $m$ can the number $m^2+1$ have? [closed]

Here is my investigation:

For $m \leq 40$, all answers are $1$ except $7, 18, 21, 38$ (which is $0$). I would like to seek for hints for this question.


Solution 1:

Suppose $m^2+1$ has at least two prime factors greater than $m$. Call these $p$ and $q$, so $p\ge m+1$ and $q\ge m+1$. Then $$ pq\ge (m+1)^2 = m^2+2m+1 > m^2+1. $$ So $pq$ is strictly larger than $m^2+1$, but also divides $m^2+1$. This is a contradiction. We conclude that at most one such prime factor can occur.

As you have already observed, it is indeed possible for $m^2+1$ to have one prime factor larger than $m$. For example, when $m=2$, we have the prime factor $5>2$. It is also possible $m^2+1$ has no prime factors greater than $m$. For example, when $m=7$, we find that the only prime factors of $7^2+1=50$ are $2$ and $5$.