<s>[INST] Square numbers and divisibility I'm trying to prove the following statement:

If $kn+1$ and $(k+1)n+1$ are both perfect squares, then $2k+1$ divides n, where k and n are positive integers.

Case $k=1$:
Put $n+1=x^2$, $2n+1=y^2$. Quadratic residues can only be $0, 1 \mod 3$.
Hence
$n \equiv 1 \mod 3 \Rightarrow x^2 = n+1 \equiv 2 \mod 3$
$n \equiv 2 \mod 3 \Rightarrow y^2 = 2n+1 \equiv 5 \equiv 2 \mod 3$
Both of them are contradictions.
Case $k=2$:
Put $2n+1=x^2$, $3n+1=y^2$. Quadratic residues can only be $0, 1, 4 \mod 5$. Hence
$n \equiv 1 \mod 5 \Rightarrow x^2 = 2n+1 \equiv 3 \mod 5$
$n \equiv 2 \mod 5 \Rightarrow y^2 = 3n+1 \equiv 2 \mod 5$
$n \equiv 3 \mod 5 \Rightarrow x^2 = 2n+1 \equiv 2 \mod 5$
$n \equiv 4 \mod 5 \Rightarrow y^2 = 3n+1 \equiv 3 \mod 5$
All of them are contradictions.
Case $k=3$:
See If 4n+1 and 3n+1 are both perfect sqares, then 56|n. How can I prove this?
It might be possible to prove further individual cases for different k.
However I'm not sure if the statement is true for all positive k and if yes, how to prove it. 
Some observations:
If $kn+1 = x^2$ and $(k+1)n+1 = y^2$ we get
$y^2-x^2=n$
$y^2+x^2=(2k+1)n+2$
$(k+1)x^2-ky^2=1$
but I have no good idea how to proceed. Any hint/help is appreciated.
 [/INST] This answer explains how your question relates to the Pell's equation and points you to various online sources which can help you to solve your problem.
The equation you have, where I've switched the $x$ and $y$ around, of
$$(k+1)y^2 - kx^2 = 1 \implies kx^2 - (k+1)y^2 = -1 \tag{1}\label{eq1A}$$
is a form of a generalized Pell equation. There's an online Solving a generalized Pell equation page where it allows you to check the solubility of equations of the form
$$ax^2 - by^2 = \pm 1 \tag{2}\label{eq2A}$$
where $1 \lt a \lt b$, $\gcd(a,b) = 1$ and $ab$ is not a perfect square. Your cases are satisfied with the right hand side of \eqref{eq1A} for $k \ge 2$ since $a = k$ and $b = k + 1$ satisfies $1 \lt k \lt k + 1$, $\gcd(k, k + 1) = 1$ and $k(k+1)$ not being a perfect square. To see the last point, note $k^2 \lt k(k+1) \lt (k+1)^2$.
The online solution calculator has a link to an explanation of how the algorithm works at A Midpoint Criterion for the Diophantine Equation $ax^2 - by^2 = \pm 1$. Also, it gives a link to a GNU BC program source code implementation. Using this, if there are no solutions, then you're done for that $k$. Otherwise, you can check each solution to see if $\frac{x^2 - 1}{k + 1} = \frac{y^2 - 1}{k} = n$ where $n$ is an integer and, if so, then whether or not $2k + 1 \mid n$.
Alternatively, take the left hand side of \eqref{eq1A}, switch $x$ and $y$ around, and multiply both sides by $k + 1$, to get
$$\begin{equation}\begin{aligned}
(k+1)^2 x^2 - k(k+1)y^2 & = k + 1 \\
(x')^2 - Dy^2 & = N
\end{aligned}\end{equation}\tag{3}\label{eq3A}$$
where $x' = (k+1)x$. This is now in the more usual form of the generalized Pell equation. There's various sites with information about how to solve this, such as at Solving the generalized Pell equation, plus multiple posts on this site, e.g., at Generalized Pell's equation.
If you use this method, then if there are any solutions at all, for each one, first confirm $x = \frac{x'}{k+1}$ is an integer. If so, then do the other previous checks mentioned (but with $x$ and $y$ switched around) for a resulting integer $n$ and, if so, then that $2k + 1 \mid n$.
</s>