If p is prime and $a^2-b^2=p$
Then solve for a and b.
In observing the equation, 1.I found a and b must be co prime. Since p is odd,not both $ a^2$ & $b^2$ is even And I found some example of a,b which solve the given equation.
Example a=2,b=3.
But I can't know how to solve it .please tell me from where I will start to solve it .
Note: this problem is in chapter of GCD and LCM.
THANKS.
$a^2-b^2=(a+b)(a-b)$, so if $(a+b)$ and $(a-b)$ are both greater than 1 (essentially, if $(a-b)>1$), then $p$ would be composite. Therefore, we need $a-b=1$, so $a=b+1$. Now substituting this back in to our original equation, we end up with $(b+1)^2-b^2=p$, so we see that $2b+1=p$. From this, we can come up with a valid pair of (a,b) for every prime $p>2$. We see that $b=\frac{p-1}{2}$ and $a=\frac{p+1}{2}$.