problem involving prime numbers.

58 Views Asked by At

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.

2

There are 2 best solutions below

6
On BEST ANSWER

$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}$.

0
On

Note that $a^2-b^2=(a+b)(a-b)=p$. If $a>b>0$ are positive integers then $a+b>a-b$ are integer factors of $p$. This means that there is only one possibility $a-b=1$ and $a+b=p$, that is $a=(p+1)/2$ and $b=(p-1)/2$ for any prime $p>2$ (when $p=2$ then $a$ and $b$ are not integers, on the other hand $p$ is odd for $p>2$).