How show that $40 \mid n.$ Let $n\in\mathbb N$ s.t. $2n+1$, $3n+1$ are squares. Show that $40 \mid n.$
I have shown that $8 \mid n.$ Please help me to show $5 \mid n.$

For $5 | n$ we have:
$3n+1=a^2 ⇒ 3n=(a-1)(a+1)$
$a-1$ and $a+1$ are two consecutive numbers, therefore n must also be consecutive to 3 that is $n=5$ or $5 | n$
Also:
$2n+1 =b^2 ⇒ 2n=(b-1)(b+1)$
$b-1$ and $b+1$ are consecutive numbers therefore n must also be consecutive to 2 that is $n=4$ or $4|n$ . So n can be the least common multiplier(LCM)   of 4 and 5, that is $n=20$ or $20|n$. However when $20|n$ then the last digit of numbers$3n+1$ and $2n+1$ is 1, this is possible only when they are square of numbers with 1 or 9 as their last digit, i.e numbers such as 9, 11, 19,21,29,31... that indicate minimum value of n is 40 and generally 40 must divide n. 
