Q:

Primes of the form $16\cdot m^{2}+31\cdot m$

How would I determine all primes of the form $16\cdot m^{2}+31\cdot m$.
And in general how do you determine primes of various forms. 

A:

This is $m(16m+31)$, so cannot be prime unless $m=\pm 1$ or $16m+31=\pm 1$. Now test which ones of these $4$ possibilities give a prime.  
Remark: Your expression had very special shape. A similar strategy can be used for polynomials $P(m)$ that happen to factor nicely. But when there is no natural factorization, this kind of problem can be very difficult. 

