find all solutions to 2p + 1 = n^2, for n natural, p prime

if n is a natural number and p is a prime number find all solutions to 2p + 1 = n^2

Since 2p + 1 is always odd, only the odd squares are candidates.

i.....1.....2.....3.....4.....5...
n.....1.....3.....5.....7.....9...
n^2...1.....9....25....49....81...
p.....0.....4....12....24....40...
Diff....4.....8.....12....16
Diff.......4.....4......4
With the 2nd differences being constant at 4, the general expression for p is of the form p = ai^2 + bi + c

Using the data above, we can write
a(1^2) + b(1) + c = 0 or a + b + c = 0
a(2^2) + b(2) + c = 4 or 4a + 2b + c = 4
a(3^2) + b(3) + c = 12 or 9a + 3b + c = 12

Solving, a = 2, b = -2 and c = 0

Therefore, p = 2i^2 - 2i or p = 2i(i - 1)

Since p always has a factor of 2, there is no prime number that will satisfy n^2 = 2p + 1.
 
Top