# If $s$ and $g>0$ are integers, how can I prove that $x$ and $y$ exist  satisfying $x+y=s$ and $(x,y)=g$ if and only if $g \mid s$?

I am already able to prove that $g \mid s$ assuming $x+y=s$ and $(x,y)=g$, but I am having some trouble showing that assuming $g \mid s$, there exists an $x$ and $y$ such that $x+y=s$ and $(x,y)=g$. So far, I've started with saying that $g \mid 0$ necessarily. Therefore we also know that $g \mid (0x+sy)$. I'd like to be able to set the values of $x$ and $y$ to something to show that there exist an $x$ and a $y$ that satisfy $x+y=s$ and $(x,y)=g$, but I'm not really sure where to go from here. Can anyone offer any help?

-

## 2 Answers

HINT. $(gn,g) = g(n,1)=g$.

The converse follows because $a|b$ and $a|c$ implies $a|b+c$.

-

I'm not sure I understand what your hint is referring to. Can you offer a little more clarification please? – user6548 Feb 2 '11 at 20:48
@user6548: $gn+g = g(n+1)$. If $g|s$, can you write $s$ as $g(n+1)$ for some $n$? – Arturo Magidin Feb 2 '11 at 20:51
I'm very sorry, but I'm still having trouble wrapping my head around how this fits in.  Does this eliminate the need to mention that g|0 and thus, the need to mention that g|(0x+sy)? If not, how do these follow one another? – user6548 Feb 2 '11 at 21:07
@user6548: If $g|s$, then $s=gd$ for some $d$. Write $d=(d-1)+1$. Can you now write $s$ as the sum of $gn$ and $g$ for some $n$? – Arturo Magidin Feb 2 '11 at 21:08
Ah, that clears things up perfectly.  Thank you. – user6548 Feb 2 '11 at 21:18

$\rm\ \ g = (x,s-x) = (x,s)\ \iff\ 1 = (x/g,\:s/g)\:,\$ so choose $\rm x/g\$ coprime to $\rm s/g\:,\$ e.g. $\rm\ s/g + 1$

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 44, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9536942839622498, "perplexity_flag": "head"}