Question: Find the least positive integer $m$ such that $m^2 - m + 11$ is a product of at least four not necessarily distinct primes.

I tried but not able to solve it.

**Edit** : Please note that I am looking for mathematical solution not the programming one.

Answer: 
Let the equality $$m(m-1)+11=N$$ It is clear that $N$ must be odd and that can be divisible by the prime $11$. However the following congruences have no solution as it is easy to prove directly checking the few possibilities with $m(m-1)$ not divisible by $3,5$ and $7$ respectively

$$\begin{cases}m(m-1)+2\equiv 0\pmod3\\m(m-1)+1\equiv 0\pmod5\\m(m-1)+4\equiv 0\pmod7\end{cases}$$

Thus $N=\prod p\_i^{a\_i}$ with $p\_i\ge11$.

A necessary condition is that (solving the quadratic in $m$) $$\sqrt{4N-43}=x^2$$ and from this we need that $$N\equiv 1,3,7\pmod{10}$$ By chance we find the minimum $N=11^3\cdot13$ which corresponds to $\color{red}{m=132}$ and that could have been calculated by direct trials but the next solution seems to be far from $132$.
$$132^2 - 132 + 11 = 11 \times 11 \times 11 \times 13$$

[Pyth program](http://pyth.herokuapp.com/?code=f%3C3lP%2B%2aTtT11&debug=0):

```
f<3lP+*TtT11

```