We are given a2+p2=b2, where a, b are positive integers and p is a prime number.
Rewrite the equation:
b2−a2=p2
(b−a)(b+a)=p2
Since p is prime, p2 has only three positive divisors: 1, p, p2.
So, the pairs (b−a,b+a) must be (1,p2), (p,p), or (p2,1).
But b+a>b−a, so only (b−a,b+a)=(p,p) or (1,p2) are possible.
Case 1: b−a=p, b+a=p
Then b−a=b+a implies a=0, which is not allowed since a is positive.
Case 2: b−a=1, b+a=p2
Then:
b−a=1⟹b=a+1
b+a=p2
Add the two equations:
(b−a)+(b+a)=1+p2=2b⟹2b=p2+1⟹b=2p2+1
Subtract the first from the second:
(b+a)−(b−a)=p2−1=2a⟹a=2p2−1
Now, a and b are positive integers for any odd prime p (since p2 is odd, so p2+1 and p2−1 are even).
Now, compute 2(b+p):
2(b+p)=2(2p2+1+p)=(p2+1)+2p=p2+2p+1=(p+1)2
Thus, 2(b+p) is a perfect square, as required.