Given $a\in\mathbb{R}$, such that the two roots in $$f(x)=x^2+ax+(2a+319)$$ are both positive integers. Find $a$.
I've found that$$D=a^2-4\times(2a+319) = a^2-8a-1276$$
Since the two roots are integers, $$D=N^2, n\in\mathbb{N}$$ $$a^2-8a-1276=N^2$$
That's all I got. How can I move further?
Actually, $D=a^2-8a\color{red}-1276$
You have\begin{align}a^2-8a-1276=N^2&\iff(a-4)^2-1292=N^2\\&\iff1292=(a-4-N)(a-4+N).\end{align}So, for any way of writing $1292$ as $k\times l$ ($k,l\in\Bbb Z$), solve the system$$\left\{\begin{array}{l}a-4-N=k\\a-4+N=l.\end{array}\right.$$For instance, if $k=-34$, and $l=-38$, you will get $a=-32$ and the roots will be $15$ and $17$.