Problem: Let $s$ and $g>0$ be given integers. Prove that integers $x$ and $y$ exist satisfying $x+y=s$ and $(x,y)=g$ iff $g|s$.
My Attempt I have already proved the theorem in the "right " direction. So I shall write the converse: Assuming $g|s$ then if we let $x=g$ and $y=s-g$, we get $(x,y)=(g,s-g)=g$ and $x+y=g+s-g=s.$ Thus there exists $x$ and $y$ such that the requirements of the problem are met.
Please tell me whether the proof of the converse is correct or not? Thanks in advance!