13. A. Given integers $a, b$ satisfy $a-b$ is a prime number, and $ab$ is a perfect square. When $a \geqslant 2012$, find the minimum value of $a$.
13. A. Let $a-b=m$ (where $m$ is a prime number), and $ab=n^2$ (where $n$ is a non-negative integer).
When $b \neq 0$,
$$
\begin{array}{l}
\text { From }(a+b)^{2}-4ab=(a-b)^{2} \\
\Rightarrow(2a-m)^{2}-4n^{2}=m^{2} \\
\Rightarrow(2a-m+2n)(2a-m-2n)=m^{2} .
\end{array}
$$

Since $2a-m+2n$ and $2a-m-2n$ are both positive integers, and $2a-m+2n > 2a-m-2n$ (since $m$ is a prime number),
we have $\left\{\begin{array}{l}2a-m+2n=m^{2} \\ 2a-m-2n=1 .\end{array}\right.$,
Solving these, we get $a=\frac{(m+1)^{2}}{4}, n=\frac{m^{2}-1}{4}$.
Thus, $b=a-m=\frac{(m-1)^{2}}{4}$.
Also, $a \geqslant 2012$, i.e., $\frac{(m+1)^{2}}{4} \geqslant 2012$.
Since $m$ is a prime number, solving this gives $m \geqslant 89$.
At this point, $a \geqslant \frac{(89+1)^{2}}{4}=2025$.
When $b=0$,
from $a-b=a=m$, we know that $a=m$ is a prime number.
Also, $a \geqslant 2012$, so the smallest prime number is 2017.
Therefore, the minimum value of $a$ is 2017.