A positive integer n is such that numbers 2n+1 and 3n+1 are perfect squares. Prove that n is divisible by 8.

thanks

2 answers

I sort of "cheated" by running a quick computer program.
in the first 1 million values of n
I found only 3 values of n that satisfied your condition.
they were 40, 3960, and 388080

All 3 are divisible by 8

I can't think of a "mathematical" way to do you question.
Modulo 8, a square can only be 0, 1 or 4:

0^2 = 0

1^2 = 1

2^2 = 4

3^2 = 1

4^2 = 0

The squares of 5, 6 and 7 are the same as the squares of 3, 2 and 1.

Since 2n + 1 is odd and is a square, it must be 1 modulo 8. So, Mod 8 we have:

2 n + 1 = 1 ------>

2 n = 0

So, we know that n is a multiple of 4, so we can be sure that n is even. But this means that 3n + 1 must be odd. Because 3 n + 1 is a square, it follows that 3 n + 1 Modulo 8 equals 1. So, Modulo 8 we have:

2 n + 1 = 1

3 n + 1 = 1

Subtracting gives (Modulo 8):

n = 0

So, n is a multiple of 8.