If 4n+1 and 3n+1 are both perfect sqares, then 56|n. How can I prove this?

$3n+1=a^2$ and $4n+1=b^2$ gives $4a^2-3b^2=1$. With $x=2a$ and $y=b$ we get an instance of Pell's equation.

$$x^2-3y^2=1.$$

Trying small integers, it is obvious that the minimal solution is $4-3=1$, that is $x_1=2$ and $y_1=1$.

Therefore, all the solutions are of the form $(x_k,y_k)$ with $x_k+y_k\sqrt 3=(x_1+y_1\sqrt 3)^k$ or equivalently $$ \begin{align} x_{k+1}&=2x_k+3y_k\\ y_{k+1}&=x_k+2y_k, \end{align} $$ (which already works starting from the trivial solution $x_0=1$, $y_0=0$).

This gives $3y_{k+1} =3x_k+6y_k$ which implies $$\begin{align}&x_{k+2}-2x_{k+1}=3x_k+2x_{k+1}-4x_k\\ \Leftrightarrow &x_{k+2}-4x_{k+1}+x_k=0 \end{align}$$ and $x_0=1$, $x_1=2$.

Clearly, the $x_i$ alternate in sign and we are only interested in the even ones which are those with odd index. $$\begin{align}x_{2k+1} &= 4x_{2k}-x_{2k-1}\\&=4(4x_{2k-1}-x_{2k-2})-x_{2k-1}\\ &=15x_{2k-1}-x_{2k-1}-x_{2k-3}\\&=14x_{2k-1}-x_{2k-3}.\end{align}$$

Upon division by two, we obtain the recurrence for the solutions $a_k$ to $3n+1=a^2$ subject to the other condition.

$$a_k=14a_{k-1}-a_{k-2},$$ with $a_0=1$ and $a_1=13(=\dfrac{x_3}2)$.

Now, it is trivial to check that modulo $3$, all $a_k$ are $\equiv 1$ because $14\cdot 1 - 1 \equiv 1 \mod 3$. Which implies that $3 \mid a^2-1$.

Furthermore, modulo $7$, all $a_k$ are $\equiv \pm 1$ because $a_k \equiv - a_{k-2} \mod 7$ which implies that $7 \mid a^2-1$.

And finally, modulo $4$, all $a_k$ are $\equiv 1$ because $14-1 \equiv 1 \mod 4$ which implies that $8 \mid (a-1)(a+1)=a^2-1$.

So, in summary, $56 \mid \dfrac{a^2-1}3$ as desired.