There is a pattern, but not one you can see just by looking at the values of $a$.
Theorem. For a positive nonsquare integer $D$, the equation $x^2 - Dy^2 = -1$ has a solution in integers if and only if the continued fraction expansion of $\sqrt{D}$ has an odd period.
That theorem gives you a pattern. Maybe it's not what you wanted, but we can't expect simple answers to all simple-sounding questions.
It turns out that we can write down a simple general rule for $\sqrt{a^2+1}$ and simple rules for $\sqrt{a^2+4}$ depending on the parity of $a$, but in higher cases things get more complicated.
For $a \geq 1$,
$$
\sqrt{a^2+1} = [a,2a,2a,2a,2a,\ldots] = [a, \overline{2a}],
$$
which has period $1$.
For odd $a \geq 3$,
$$
\sqrt{a^2+4} = [a,\overline{(a-1)/2,1,1,(a-1)/2,2a}],
$$
which has period $5$, while for even $a \geq 2$,
$$
\sqrt{a^2+4} = [a,\overline{a/2,2a}],
$$
which has period $2$.
The periods for $\sqrt{a^2+9}$ when $a \geq 1$ (and $a \not= 4$, so $\sqrt{a^2+9}$ is irrational) look erratic: starting with $a = 1$ and skipping $a = 4$, the periods are $1, 5, 2, 4, 6, 7, 7, 2, 15, 3, 8, 6, 8, 8, 9, \ldots$, so you can see that there's not a simple rule here for even vs. odd periods.
Be thankful that there is a nice rule at all when $D = a^2+1$.
There has been recent work on densities of (squarefree) $D$ for which $x^2 - Dy^2 = -1$ is solvable: see https://arxiv.org/abs/2201.13424.