If $2n+1$ and $3n+1$ are perfect squares, then prove that $8|n$. 
If for some number $n\in \mathbb N$, the numbers $2n+1$ and $3n+1$ are perfect squares of integers, then prove that $8|n$.

if $2n+1=m^2$ and $3n+1=k^2$ then $k^2-m^2=3n-2n+1-1=n$ now I need to show that $8|k^2-m^2$ when you divide a some number $m^2$ with $8$ then remainder is $0,1,4$, so I need to show that $m^2$ and $k^2$ have the same remainder. But I do not know is this good way because I do not know how to prove that they must have the same remainder
 A: If $k$ is odd, then $k^2\equiv1 \mod 8$. Hence $3n+1\equiv1\mod 8$, $2n+1\equiv 1\mod 8$, so
$$(3n+1)-(2n+1)\equiv 1-1\equiv 0\mod 8$$
A: It's a standard exercise that if $b > a$ and $a$ and $b$ are both odd that
i) $a + b$ and $a-b$ are both even and that
ii) exactly one of $a+b$ and $a-b$ is divisible by $4$.

Pf: Let $b = 2m + 1$ and $a = 2n+1$ so $b-a = 2(m-n)$ and $b+a = 2(m+n+1)$ are both even.
If $m$ and $n$ are both even or both odd then $m-n$ is even and $m+n + 1$ is odd so $4|b-a$ but $4\not \mid b+a$.  If $m$ and $n$ are opposite paritty then the exact opposite occurs; $m-n$ is odd and $m+n +1$ is even so $4\not \mid b-a$ and $4\mid b+a$.

As a consequence $b^2 - a^2 = (b-a)(b+a)$ is divisible by $8$.
So if we have $2n + 1 = a^2$ then $a^2$ is odd so $a$ is odd.
AND we have $2n = a^2 -1 = (a-1)(a+1)$ is divisible by $8$ so $n$ is even.
And if $3n + 1=b^2$ then we have $n$ is even so $b^2$ is odd so $b$ is odd.
So $n = (3n+1)-(2n+1) =b^2 - a^2$ where $a,b$ are both odd..... which is divisible by $8$.
A: Odd squares are all congruent to $1$ mod $8$, so if $2n+1$ is a square, we must have $4\mid n$.  Writing $n=4n'$, we now have $3n+1=12n'+1$, which, if it's square, must also be congruent to $1$ mod $8$, so we must have $2\mid n'$.  Writing $n'=2n''$, we have $n=4n'=8n''$, so $8\mid n$.
A: We have $2n+1, 3n+1 \equiv \{0,1,4 \} \mod 8,$ whereupon checking $n = 0, 1, \dots, 7,$ we see that only $n \equiv 0 \mod 8$ works.
Snookie has shown that $40 | n.$ Indeed, we can show $5 | n$ in a similar fashion by noting that $2n + 1 \equiv \{0, 1\} \mod 5$ implies $n \equiv 0 \mod 5$ by checking $0, 1, \dots, 4.$
Since $n=40$ works, this is the strongest result that we can prove.
