Consider the diophantine
$$ x^2 + t(n) \space y^2 = n $$
Where $x,y> 0$, $ n>1$ and $t(n) > -1$.
For a given $n$ we want to find the smallest possible integer $t(n)$.
Clearly when $n$ is a square then $t(n) = 0 $. When $ n = a^2 \space b $ then $ t(n)$ is at most $t(b)$. If $ n $ is a prime 1 mod 4 then $t(n) = 1 $. Also $ t(n) < n$ is trivial as $1^2+(n-1)1^2=n$
Clearly, primes of type $s \mod d$ with prime $d$ and $s > 0$ are related. And trivially Pell’s equation, and hence also continued fractions are related.
I have seen a lot of related things but I have not seen $t(n)$ discussed.
What is known about $t(n) $ ??
The sequence starts like
$$ t(2) = 1, t(3) = 2 , t(4) = 0 , t(5) = 1 , t(6) = 2 , t(7) = 3 , t(8) = 1 , t(9) = 0 , ... $$
I could not find it on the OEIS.