recently I had to solve some diophantine equations in the form $x^2 + n y^2 = b $ in the variables $x$ and $y$, for various fixed values of $n$, and $b$.
Other than "bruteforcing" it, are there some ways to know if, given $n$ and $b$, this equation has at least a solution?
Edit: $n$ and $b$ are both positive integers