If $2n+1$ and $3n+1$ are both perfect squares then prove that $40$ divides $n$.
I tried to solve the problem by taking $a$'s values as multiples of $40$. But the number of such cases would not ever end. So, Probably I need to use some theory- how should I approach this problem?
If $x$ is a square mod 8, then $x$ is 0, 1, or 4 mod 8.
If $x$ is a square mod 5, then $x$ is 0, 1, or 4 mod 5.
So if $x$ is a square mod 40, then $x$ is 0, 1, 4, 9, 16, 20, 24, 25, or 36 mod 40.
$2n+1$ is odd, so if it's a square, then it's 1, 9, or 25 mod 40, and that means that $n$ is 0, 4, or 12 mod 20, and that means that $3n+1$ is 1, 13, or 17 mod 20, so $3n+1$ is 1, 13, 17, 21, 33, or 37 mod 40.
But looking at our list of squares mod 40, $3n+1$ must be 1 mod 40, so $n$ is a multiple of 40.