I am trying to solve an equation in integers to give a square number.
$$2 x^2 + 3 x +1 = y^2$$
while also satisfying $x=k^2 * n$ where $n$ is a very large integer given to us and $k$ can be any integer chosen to form a solution. The $y$ can be any integer needed to form a solution.
I am looking for a method to find solutions in integers only.
I am new to this kind of equation and can't tell easy from hard from impossible. This is not school work.
Thanks for your help.
I'm assuming you want it to be a perfect square, otherwise the problem is trivial.
Notice that your equation is $(2x+1)(x+1) = y^2$. Since $\gcd (2x+1, x+1) = \gcd (x, x+1) = 1 $, hence we need both $x+1$ and $2x+1$ to be perfect squares.
We thus want $(2x+1) - 2(x+1) = -1$. This is Pell's equation of the form $X^2 - 2Y^2 = -1$, and has solutions $X_k + \sqrt{2}Y_k = ( 7+ 5 \sqrt{2}) ( 3 + 2 \sqrt{2})^k$. I would suggest that you look determine this list first, and hence obtain all possible values of $x$ such that $2x^2 + 3x +1$ is a perfect square. For example, we have $(X_k, Y_k) = (7, 5), (41, 29), (239, 169), \ldots$ which gives $x = 24, 840, 28560, \ldots $. [I forgot the 'trivial solution $(1, 1)$ which yields $x=0$.]
Now, we also want $x+1 - x = 1$, which is of the form $X^2 - nY^2 = 1$ (Pell's equation). While this equation always has solutions in integers, it can be extremely hard to determine the initial (non-trivial) solution. Having done that, generate the list of possible $x$, and compare it to the previous list.