Without loss of generality, we may assume that x≤y. Suppose that 2x<y+1. Then
(2y)2<1+4x+4y<(1+2y)2,
which implies that 1+4x+4y is not a square of an integer. If 2x=y+1, then 1+4x+4y=1+2y+1+4y=(1+2y)2. Hence
(x,y,z)=(x,2x−1,1+22x−1)
is a solution of the equation for any positive integer x. Suppose that 2x>y+1. Note that
4x+4y=4x(1+4y−x)=(z−1)(z+1).
Since gcd(z−1,z+1)=2, one of z−1 or z+1 is divisible by 22x−1. This gives a contradiction because
2(1+4y−x)≤2(1+4x−2)<22x−1−2
for any x>1. Therefore the solutions are:
(x,y,z)=(x,2x−1,1+22x−1) or (2x−1,x,1+22x−1)
for any positive integer x. □