Find all integers $n \geqslant 1$ such that $2n+1$ and $3n+1$ are perfect squares.
We are looking for integers $n$ such that there exist $x, y \in \mathbb{N}^{*}$ satisfying $x^{2}=2 n+1$ and $y^{2}=3 n+1$, which is equivalent to $x^{2}=2 n+1$ and $3 x^{2}-2 y^{2}=1$. The latter equation is a Pell equation, whose smallest solution is $x=y=1$, and whose resolvent is $X^{2}-6 Y^{2}=1$. The latter admits the minimal solution $X=5$ and $Y=2$. Thus, the solutions of $3 x^{2}-2 y^{2}=1$ are all the terms of a certain sequence $\left(X_{k}, Y_{k}\right)_{k \geqslant 0}$ whose first coordinate satisfies

$$
\left(X_{k}, Y_{k}\right)=\left(\frac{1}{2}\left((5+2 \sqrt{6})^{k}+(5-2 \sqrt{6})^{k}\right), \frac{1}{2 \sqrt{6}}\left((5+2 \sqrt{6})^{k}+(5-2 \sqrt{6})^{k}\right)\right)
$$

The solutions $\left(x_{k}, y_{k}\right)$ of the Pell equation $3 x^{2}-2 y^{2}=1$ are $\left(x_{k}, y_{k}\right)=\left(X_{k}+2 Y_{k}, X_{k}+3 Y_{k}\right)$. The integers $n$ we are looking for are therefore the integers of the form $y_{k}^{2}-x_{k}^{2}=Y_{k}\left(2 X_{k}+5 Y_{k}\right), k \geqslant 0$.