$$x^2 - ny - 2 = 0, n \in Z$$
I put this equation in wolframalpha, and got integer solutions for random n = 7, 23, 31, 47, 49, 71, 73, 343.
for n = 7 it gave the integer solutions as $$x = 7 n + 3, y = 7 n^2 + 6 n + 1, n \in Z$$ $$x = 7 n + 4, y = 7 n^2 + 8 n + 2, n \in Z$$
and for n = 23 it gave the integer solutions as $$x = 23 n + 5, y = 23 n^2 + 10 n + 1, n \in Z $$ $$x = 23 n + 18, y = 23 n^2 + 36 n + 14, n \in Z $$
It was noteworthy that the sum of free numbers in x is always equal to n (i.e. coefficient of y). 7 had 3 and 4 as free-x-values, 23 had 5 and 18 as free-x-values, and so on. So, as we can see, those free-x-values are always smaller than n.
For some values (like even numbers) there weren't any solutions shown, So I guess there weren't any. But as most of these have only 2 integer solutions, some had 4 integer solutions, like 511 for an example, which had 2 pairs of free-x-values, adding to 511.
My question is, how do I determine if the equation has only exactly 2 solutions, or more than 2 solutions, for a given value of n (i.e. coefficient of y)?
I'm not particularly concerned with the solutions themselves, just that the number of solutions is just 2 or more than that. I can't try values one by one, as the coefficient of y can get large. Wolfram isn't (understandably) handling that big numbers, so I'm trying to write code to solve these equations, but as I don't know what is going on behind the scenes, I can't do anything.
Also, let's say if I find the 1st (smallest) solution, and the 4th (as their sum is predetermined). Can I use them to find the other two (2nd and 3rd) solutions, if they exist?
I looked into Diophantine equations of degree two, but the examples I found had all variables of second degree in them. So, I'm not sure if it qualifies for that. If if still does, please let me know. I tried to solve the equation as a quadratic equation, but got stumped as the coefficient of $y^2$ is 0.
My mathematical background is only upto basic highschool level. So, if I need to study some field(s), to be able to solve this, please guide me, as I'm willing to study to solve this problem.