# Proving x and y is divisible by p (prime).

If p is a prime number and x and y are integers, how do I prove "if xy and x+y are both divisible by p, then x and y is divisible by p"?

I started like this..

1) p divides xy, so p divides x or p divides y, since p is a prime number.

and then I'm already stuck :/

Help me to get to the next step please.

• If $p$ divides $x$, since $p$ divides $x+y$ then ..... – N. S. May 14 '13 at 21:46
• I understand that part but how do I get from here to proving that p also divides y? I'm not sure how to really utilize "p divides x+y" part. – user77850 May 14 '13 at 21:49

If $p$ divides $x$ but not $y$, can $p$ divide $x+y$?
$$(1)\;\;\;p\,\mid\,xy\implies\;p\,\mid\,x\;\;\vee\;\;p\,\mid\,y$$
Now suppose WLOG that $\,p\mid x\,$, and also we have $\,x+y=tp\,$ , so
$$(2)\;\;\;x=kp\implies tp=x+y=kp+y\implies\ldots\ldots$$