12.143 $a$ is a real number greater than zero. It is known that there exists a unique real number $k$, such that the quadratic equation in $x$, $x^{2}+\left(k^{2}+a k\right) x+1999+k^{2}+a k=0$, has two roots that are both prime numbers. Find the value of $a$.
(China Junior High School Mathematics League, 1999)
［Solution］Let the two prime roots of the equation be $p, q$.
By the relationship between the roots and coefficients of a quadratic equation, we have
$$
\begin{array}{c}
p+q=-k^{2}-a k, \\
p q=1999+k^{2}+a k .
\end{array}
$$
Adding (1) and (2) gives
$$
p+q+p q=1999 \text {. }
$$

That is,
$$
(p+1)(q+1)=2000=2^{4} \times 5^{3} .
$$

From (3), we know that $p$ and $q$ cannot both be 2, so $p$ and $q$ are odd primes.
If $\frac{p+1}{2}$ is odd, it must be that $\frac{p+1}{2}=5^{r} (r=1,2,3)$.
Then $p=2 \cdot 5^{r}-1$,
which means $p=9$ or 49, 249, all of which are composite numbers, so $\frac{p+1}{2}$ must be even.
Similarly, $\frac{q+1}{2}$ is also even.
Therefore, $\frac{p+1}{4}, \frac{q+1}{4}$ are both integers, and $\frac{p+1}{4} \cdot \frac{q+1}{4}=5^{3}$.
Assume without loss of generality that $p \leqslant q$, then $\frac{p+1}{4}=1$ or 5,
which gives $p=3, q=499$, or $p=19, q=99$.
But $q=99$ is not a prime number. Thus, only $p=3, q=499$.
Substituting into (1) gives $3+499=-k^{2}-a k$,
which simplifies to $k^{2}+a k+502=0$.
According to the problem, this equation has a unique real solution.
Therefore, $\Delta=a^{2}-4 \times 502=0$, yielding $a=2 \sqrt{502}$.