Prove $gcd(n,n+2)=1$ if $n$ is odd and $2$ if $n$ is even












1












$begingroup$



Prove that $gcd(n,n+2)=1$ if $n$ is odd and $gcd(n,n+2)=2$ if $n$ is even.




My Try:



So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.



If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$



$2|n$ and $2|n+2$ is not possible.



Is my above attempt correct? Are there any better ways to prove the above?










share|cite|improve this question











$endgroup$












  • $begingroup$
    When $d$ divides $a$ we can express it as $a=xd$ for some integer $x$. For another $b$ with $d$ again as a divisor it will be $b=yd$. Can you say anything about the difference $a-b$?
    $endgroup$
    – P Vanchinathan
    Dec 14 '18 at 3:07










  • $begingroup$
    What are you allowed to use/assume? If you can assume gcd(a, b) = gcd (a, a-b) then it's as trivial as saying gcd(n, n+2) = gcd (2, n) from which the result follows almost immediately.
    $endgroup$
    – Deepak
    Dec 14 '18 at 3:45
















1












$begingroup$



Prove that $gcd(n,n+2)=1$ if $n$ is odd and $gcd(n,n+2)=2$ if $n$ is even.




My Try:



So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.



If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$



$2|n$ and $2|n+2$ is not possible.



Is my above attempt correct? Are there any better ways to prove the above?










share|cite|improve this question











$endgroup$












  • $begingroup$
    When $d$ divides $a$ we can express it as $a=xd$ for some integer $x$. For another $b$ with $d$ again as a divisor it will be $b=yd$. Can you say anything about the difference $a-b$?
    $endgroup$
    – P Vanchinathan
    Dec 14 '18 at 3:07










  • $begingroup$
    What are you allowed to use/assume? If you can assume gcd(a, b) = gcd (a, a-b) then it's as trivial as saying gcd(n, n+2) = gcd (2, n) from which the result follows almost immediately.
    $endgroup$
    – Deepak
    Dec 14 '18 at 3:45














1












1








1





$begingroup$



Prove that $gcd(n,n+2)=1$ if $n$ is odd and $gcd(n,n+2)=2$ if $n$ is even.




My Try:



So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.



If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$



$2|n$ and $2|n+2$ is not possible.



Is my above attempt correct? Are there any better ways to prove the above?










share|cite|improve this question











$endgroup$





Prove that $gcd(n,n+2)=1$ if $n$ is odd and $gcd(n,n+2)=2$ if $n$ is even.




My Try:



So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.



If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$



$2|n$ and $2|n+2$ is not possible.



Is my above attempt correct? Are there any better ways to prove the above?







elementary-number-theory greatest-common-divisor






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 14 '18 at 3:21









6005

36.2k751125




36.2k751125










asked Dec 14 '18 at 3:02









user982787user982787

1117




1117












  • $begingroup$
    When $d$ divides $a$ we can express it as $a=xd$ for some integer $x$. For another $b$ with $d$ again as a divisor it will be $b=yd$. Can you say anything about the difference $a-b$?
    $endgroup$
    – P Vanchinathan
    Dec 14 '18 at 3:07










  • $begingroup$
    What are you allowed to use/assume? If you can assume gcd(a, b) = gcd (a, a-b) then it's as trivial as saying gcd(n, n+2) = gcd (2, n) from which the result follows almost immediately.
    $endgroup$
    – Deepak
    Dec 14 '18 at 3:45


















  • $begingroup$
    When $d$ divides $a$ we can express it as $a=xd$ for some integer $x$. For another $b$ with $d$ again as a divisor it will be $b=yd$. Can you say anything about the difference $a-b$?
    $endgroup$
    – P Vanchinathan
    Dec 14 '18 at 3:07










  • $begingroup$
    What are you allowed to use/assume? If you can assume gcd(a, b) = gcd (a, a-b) then it's as trivial as saying gcd(n, n+2) = gcd (2, n) from which the result follows almost immediately.
    $endgroup$
    – Deepak
    Dec 14 '18 at 3:45
















$begingroup$
When $d$ divides $a$ we can express it as $a=xd$ for some integer $x$. For another $b$ with $d$ again as a divisor it will be $b=yd$. Can you say anything about the difference $a-b$?
$endgroup$
– P Vanchinathan
Dec 14 '18 at 3:07




$begingroup$
When $d$ divides $a$ we can express it as $a=xd$ for some integer $x$. For another $b$ with $d$ again as a divisor it will be $b=yd$. Can you say anything about the difference $a-b$?
$endgroup$
– P Vanchinathan
Dec 14 '18 at 3:07












$begingroup$
What are you allowed to use/assume? If you can assume gcd(a, b) = gcd (a, a-b) then it's as trivial as saying gcd(n, n+2) = gcd (2, n) from which the result follows almost immediately.
$endgroup$
– Deepak
Dec 14 '18 at 3:45




$begingroup$
What are you allowed to use/assume? If you can assume gcd(a, b) = gcd (a, a-b) then it's as trivial as saying gcd(n, n+2) = gcd (2, n) from which the result follows almost immediately.
$endgroup$
– Deepak
Dec 14 '18 at 3:45










3 Answers
3






active

oldest

votes


















2












$begingroup$

An easy way to prove it would be:



Part 1)



Suppose $n=2k+1$ since $n$ is odd, therefore $n+2=2k+3$
Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k+1,2k+3)=gcd(2k+1,2k+3-(2k+1))=gcd(2k+1,2)$$ But $2k+1$ is odd while $2$ is even, therefore their gcd will have to be $1$. Meaning that $gcd(n, n+2)=1$ if $n$ is odd.



Part 2)



Now we can suppose $n=2k$, therefore $n+2=2k+2$
Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k,2k+2)=gcd(2k,2k+2-(2k))=gcd(2k,2)$$
Now since $2k$ is even, that means $2$ can be a common divisor and it would be the largest as we know that $gcd(a, b)le a, b$. This gives us that $gcd(n, n+2)=2$ if $n$ is even.






share|cite|improve this answer









$endgroup$









  • 1




    $begingroup$
    This is basically using the idea in my comment, except more verbosely. Again, the question is: what can be assumed in solving this question?
    $endgroup$
    – Deepak
    Dec 14 '18 at 4:24





















1












$begingroup$

I did not quite understand your attempted solution.




So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.




Are you saying that if $k$ is even, then $k$ is not the common divisor of $n$ and $n+2$?
That won't be true unless $n$ is odd. Maybe you meant to say "We consider the case that $n$ is odd first."?



Additionally, this statement requires justification. Did you mean to say, "First I will show that for any even number $k$, $k$ is not the common divisor of $n$ and $n+2$."?




If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$




I think you meant to say: "Since $k$ is even, $2 mid k$. Additionally, suppose towards contradiction that $k mid n$ and $k mid n+2$ (we will show that this is impossible). Then also $2 mid n$ and $2 mid n+2$."




$2|n$ and $2|n+2$ is not possible.




I would not say it's "not possible". Do you mean that it contradicts the fact that $n$ is odd, which we assumed earlier?



If you're doing a proof by contradiction, always say so, and end with a contradiction!




Is my above attempt correct? Are there any better ways to prove the above?




There is a problem with your proof. First, it seems like you only considered the case where $n$ is odd. Second, it seems like you just showed that the common divisor of $n$ and $n+2$ cannot be even. But, what if the common divisor of $n$ and $n+2$ is $3$? What if it is $5$? You need to show that it is $1$, not just that it is not even.



I would suggest you try to write down your ideas more carefully. Once you can write down the ideas carefully, it may help you write a correct solution. Do not allow yourself to make any jumps in the argument that are not perfectly logical and correct.






share|cite|improve this answer









$endgroup$





















    0












    $begingroup$

    There are some areas left vague, the part proving $k$ is not a greatest common divisor of $n$ and $n+2$ (actually this is false, let $k=2$) and showing $2|n$ and $2|n+2$ is impossible.



    Part 1: you need to add that $k>2$ or else the statement is false, and show why the statement is true for $k>2$. You can show that for $nequiv 0mod k$ and $n+2equiv 0mod k$, we can convert the statements to $0equiv -nmod k$ and $2equiv -nmod k$ and since $-nequiv 0mod k$, the statements become $2equiv0mod k$ (we can ignore $0equiv0mod k$ since that is true for all $k$ and is redundant). We can see that the above statement is not true for $k>2$, so the statement is false.



    Part 2: Let us define $m$ such that $m=n-1$ if $n$ is odd. Since $2|m$, $nequiv1mod2$ and $n+2equiv3equiv1mod2$. So $2nmid n$ and $2nmid n+2$ for odd $n$. Since Part $1$, when generalized to all values of $k$, involves $nequiv0mod2$, it shows $n+2equiv0mod2$.






    share|cite|improve this answer









    $endgroup$













      Your Answer





      StackExchange.ifUsing("editor", function () {
      return StackExchange.using("mathjaxEditing", function () {
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
      });
      });
      }, "mathjax-editing");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "69"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      noCode: true, onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3038877%2fprove-gcdn-n2-1-if-n-is-odd-and-2-if-n-is-even%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      2












      $begingroup$

      An easy way to prove it would be:



      Part 1)



      Suppose $n=2k+1$ since $n$ is odd, therefore $n+2=2k+3$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k+1,2k+3)=gcd(2k+1,2k+3-(2k+1))=gcd(2k+1,2)$$ But $2k+1$ is odd while $2$ is even, therefore their gcd will have to be $1$. Meaning that $gcd(n, n+2)=1$ if $n$ is odd.



      Part 2)



      Now we can suppose $n=2k$, therefore $n+2=2k+2$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k,2k+2)=gcd(2k,2k+2-(2k))=gcd(2k,2)$$
      Now since $2k$ is even, that means $2$ can be a common divisor and it would be the largest as we know that $gcd(a, b)le a, b$. This gives us that $gcd(n, n+2)=2$ if $n$ is even.






      share|cite|improve this answer









      $endgroup$









      • 1




        $begingroup$
        This is basically using the idea in my comment, except more verbosely. Again, the question is: what can be assumed in solving this question?
        $endgroup$
        – Deepak
        Dec 14 '18 at 4:24


















      2












      $begingroup$

      An easy way to prove it would be:



      Part 1)



      Suppose $n=2k+1$ since $n$ is odd, therefore $n+2=2k+3$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k+1,2k+3)=gcd(2k+1,2k+3-(2k+1))=gcd(2k+1,2)$$ But $2k+1$ is odd while $2$ is even, therefore their gcd will have to be $1$. Meaning that $gcd(n, n+2)=1$ if $n$ is odd.



      Part 2)



      Now we can suppose $n=2k$, therefore $n+2=2k+2$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k,2k+2)=gcd(2k,2k+2-(2k))=gcd(2k,2)$$
      Now since $2k$ is even, that means $2$ can be a common divisor and it would be the largest as we know that $gcd(a, b)le a, b$. This gives us that $gcd(n, n+2)=2$ if $n$ is even.






      share|cite|improve this answer









      $endgroup$









      • 1




        $begingroup$
        This is basically using the idea in my comment, except more verbosely. Again, the question is: what can be assumed in solving this question?
        $endgroup$
        – Deepak
        Dec 14 '18 at 4:24
















      2












      2








      2





      $begingroup$

      An easy way to prove it would be:



      Part 1)



      Suppose $n=2k+1$ since $n$ is odd, therefore $n+2=2k+3$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k+1,2k+3)=gcd(2k+1,2k+3-(2k+1))=gcd(2k+1,2)$$ But $2k+1$ is odd while $2$ is even, therefore their gcd will have to be $1$. Meaning that $gcd(n, n+2)=1$ if $n$ is odd.



      Part 2)



      Now we can suppose $n=2k$, therefore $n+2=2k+2$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k,2k+2)=gcd(2k,2k+2-(2k))=gcd(2k,2)$$
      Now since $2k$ is even, that means $2$ can be a common divisor and it would be the largest as we know that $gcd(a, b)le a, b$. This gives us that $gcd(n, n+2)=2$ if $n$ is even.






      share|cite|improve this answer









      $endgroup$



      An easy way to prove it would be:



      Part 1)



      Suppose $n=2k+1$ since $n$ is odd, therefore $n+2=2k+3$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k+1,2k+3)=gcd(2k+1,2k+3-(2k+1))=gcd(2k+1,2)$$ But $2k+1$ is odd while $2$ is even, therefore their gcd will have to be $1$. Meaning that $gcd(n, n+2)=1$ if $n$ is odd.



      Part 2)



      Now we can suppose $n=2k$, therefore $n+2=2k+2$
      Now if we want to find their gcd we would get that $$gcd(n,n+2)=gcd(2k,2k+2)=gcd(2k,2k+2-(2k))=gcd(2k,2)$$
      Now since $2k$ is even, that means $2$ can be a common divisor and it would be the largest as we know that $gcd(a, b)le a, b$. This gives us that $gcd(n, n+2)=2$ if $n$ is even.







      share|cite|improve this answer












      share|cite|improve this answer



      share|cite|improve this answer










      answered Dec 14 '18 at 3:41









      user587054user587054

      48011




      48011








      • 1




        $begingroup$
        This is basically using the idea in my comment, except more verbosely. Again, the question is: what can be assumed in solving this question?
        $endgroup$
        – Deepak
        Dec 14 '18 at 4:24
















      • 1




        $begingroup$
        This is basically using the idea in my comment, except more verbosely. Again, the question is: what can be assumed in solving this question?
        $endgroup$
        – Deepak
        Dec 14 '18 at 4:24










      1




      1




      $begingroup$
      This is basically using the idea in my comment, except more verbosely. Again, the question is: what can be assumed in solving this question?
      $endgroup$
      – Deepak
      Dec 14 '18 at 4:24






      $begingroup$
      This is basically using the idea in my comment, except more verbosely. Again, the question is: what can be assumed in solving this question?
      $endgroup$
      – Deepak
      Dec 14 '18 at 4:24













      1












      $begingroup$

      I did not quite understand your attempted solution.




      So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.




      Are you saying that if $k$ is even, then $k$ is not the common divisor of $n$ and $n+2$?
      That won't be true unless $n$ is odd. Maybe you meant to say "We consider the case that $n$ is odd first."?



      Additionally, this statement requires justification. Did you mean to say, "First I will show that for any even number $k$, $k$ is not the common divisor of $n$ and $n+2$."?




      If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$




      I think you meant to say: "Since $k$ is even, $2 mid k$. Additionally, suppose towards contradiction that $k mid n$ and $k mid n+2$ (we will show that this is impossible). Then also $2 mid n$ and $2 mid n+2$."




      $2|n$ and $2|n+2$ is not possible.




      I would not say it's "not possible". Do you mean that it contradicts the fact that $n$ is odd, which we assumed earlier?



      If you're doing a proof by contradiction, always say so, and end with a contradiction!




      Is my above attempt correct? Are there any better ways to prove the above?




      There is a problem with your proof. First, it seems like you only considered the case where $n$ is odd. Second, it seems like you just showed that the common divisor of $n$ and $n+2$ cannot be even. But, what if the common divisor of $n$ and $n+2$ is $3$? What if it is $5$? You need to show that it is $1$, not just that it is not even.



      I would suggest you try to write down your ideas more carefully. Once you can write down the ideas carefully, it may help you write a correct solution. Do not allow yourself to make any jumps in the argument that are not perfectly logical and correct.






      share|cite|improve this answer









      $endgroup$


















        1












        $begingroup$

        I did not quite understand your attempted solution.




        So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.




        Are you saying that if $k$ is even, then $k$ is not the common divisor of $n$ and $n+2$?
        That won't be true unless $n$ is odd. Maybe you meant to say "We consider the case that $n$ is odd first."?



        Additionally, this statement requires justification. Did you mean to say, "First I will show that for any even number $k$, $k$ is not the common divisor of $n$ and $n+2$."?




        If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$




        I think you meant to say: "Since $k$ is even, $2 mid k$. Additionally, suppose towards contradiction that $k mid n$ and $k mid n+2$ (we will show that this is impossible). Then also $2 mid n$ and $2 mid n+2$."




        $2|n$ and $2|n+2$ is not possible.




        I would not say it's "not possible". Do you mean that it contradicts the fact that $n$ is odd, which we assumed earlier?



        If you're doing a proof by contradiction, always say so, and end with a contradiction!




        Is my above attempt correct? Are there any better ways to prove the above?




        There is a problem with your proof. First, it seems like you only considered the case where $n$ is odd. Second, it seems like you just showed that the common divisor of $n$ and $n+2$ cannot be even. But, what if the common divisor of $n$ and $n+2$ is $3$? What if it is $5$? You need to show that it is $1$, not just that it is not even.



        I would suggest you try to write down your ideas more carefully. Once you can write down the ideas carefully, it may help you write a correct solution. Do not allow yourself to make any jumps in the argument that are not perfectly logical and correct.






        share|cite|improve this answer









        $endgroup$
















          1












          1








          1





          $begingroup$

          I did not quite understand your attempted solution.




          So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.




          Are you saying that if $k$ is even, then $k$ is not the common divisor of $n$ and $n+2$?
          That won't be true unless $n$ is odd. Maybe you meant to say "We consider the case that $n$ is odd first."?



          Additionally, this statement requires justification. Did you mean to say, "First I will show that for any even number $k$, $k$ is not the common divisor of $n$ and $n+2$."?




          If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$




          I think you meant to say: "Since $k$ is even, $2 mid k$. Additionally, suppose towards contradiction that $k mid n$ and $k mid n+2$ (we will show that this is impossible). Then also $2 mid n$ and $2 mid n+2$."




          $2|n$ and $2|n+2$ is not possible.




          I would not say it's "not possible". Do you mean that it contradicts the fact that $n$ is odd, which we assumed earlier?



          If you're doing a proof by contradiction, always say so, and end with a contradiction!




          Is my above attempt correct? Are there any better ways to prove the above?




          There is a problem with your proof. First, it seems like you only considered the case where $n$ is odd. Second, it seems like you just showed that the common divisor of $n$ and $n+2$ cannot be even. But, what if the common divisor of $n$ and $n+2$ is $3$? What if it is $5$? You need to show that it is $1$, not just that it is not even.



          I would suggest you try to write down your ideas more carefully. Once you can write down the ideas carefully, it may help you write a correct solution. Do not allow yourself to make any jumps in the argument that are not perfectly logical and correct.






          share|cite|improve this answer









          $endgroup$



          I did not quite understand your attempted solution.




          So, first I took some $k$ to be even then $k$ is not the common divisor of $n$ and $n+2$.




          Are you saying that if $k$ is even, then $k$ is not the common divisor of $n$ and $n+2$?
          That won't be true unless $n$ is odd. Maybe you meant to say "We consider the case that $n$ is odd first."?



          Additionally, this statement requires justification. Did you mean to say, "First I will show that for any even number $k$, $k$ is not the common divisor of $n$ and $n+2$."?




          If $k|n$ and $k|n+2$ as $k$ is even $implies 2|k$




          I think you meant to say: "Since $k$ is even, $2 mid k$. Additionally, suppose towards contradiction that $k mid n$ and $k mid n+2$ (we will show that this is impossible). Then also $2 mid n$ and $2 mid n+2$."




          $2|n$ and $2|n+2$ is not possible.




          I would not say it's "not possible". Do you mean that it contradicts the fact that $n$ is odd, which we assumed earlier?



          If you're doing a proof by contradiction, always say so, and end with a contradiction!




          Is my above attempt correct? Are there any better ways to prove the above?




          There is a problem with your proof. First, it seems like you only considered the case where $n$ is odd. Second, it seems like you just showed that the common divisor of $n$ and $n+2$ cannot be even. But, what if the common divisor of $n$ and $n+2$ is $3$? What if it is $5$? You need to show that it is $1$, not just that it is not even.



          I would suggest you try to write down your ideas more carefully. Once you can write down the ideas carefully, it may help you write a correct solution. Do not allow yourself to make any jumps in the argument that are not perfectly logical and correct.







          share|cite|improve this answer












          share|cite|improve this answer



          share|cite|improve this answer










          answered Dec 14 '18 at 3:16









          60056005

          36.2k751125




          36.2k751125























              0












              $begingroup$

              There are some areas left vague, the part proving $k$ is not a greatest common divisor of $n$ and $n+2$ (actually this is false, let $k=2$) and showing $2|n$ and $2|n+2$ is impossible.



              Part 1: you need to add that $k>2$ or else the statement is false, and show why the statement is true for $k>2$. You can show that for $nequiv 0mod k$ and $n+2equiv 0mod k$, we can convert the statements to $0equiv -nmod k$ and $2equiv -nmod k$ and since $-nequiv 0mod k$, the statements become $2equiv0mod k$ (we can ignore $0equiv0mod k$ since that is true for all $k$ and is redundant). We can see that the above statement is not true for $k>2$, so the statement is false.



              Part 2: Let us define $m$ such that $m=n-1$ if $n$ is odd. Since $2|m$, $nequiv1mod2$ and $n+2equiv3equiv1mod2$. So $2nmid n$ and $2nmid n+2$ for odd $n$. Since Part $1$, when generalized to all values of $k$, involves $nequiv0mod2$, it shows $n+2equiv0mod2$.






              share|cite|improve this answer









              $endgroup$


















                0












                $begingroup$

                There are some areas left vague, the part proving $k$ is not a greatest common divisor of $n$ and $n+2$ (actually this is false, let $k=2$) and showing $2|n$ and $2|n+2$ is impossible.



                Part 1: you need to add that $k>2$ or else the statement is false, and show why the statement is true for $k>2$. You can show that for $nequiv 0mod k$ and $n+2equiv 0mod k$, we can convert the statements to $0equiv -nmod k$ and $2equiv -nmod k$ and since $-nequiv 0mod k$, the statements become $2equiv0mod k$ (we can ignore $0equiv0mod k$ since that is true for all $k$ and is redundant). We can see that the above statement is not true for $k>2$, so the statement is false.



                Part 2: Let us define $m$ such that $m=n-1$ if $n$ is odd. Since $2|m$, $nequiv1mod2$ and $n+2equiv3equiv1mod2$. So $2nmid n$ and $2nmid n+2$ for odd $n$. Since Part $1$, when generalized to all values of $k$, involves $nequiv0mod2$, it shows $n+2equiv0mod2$.






                share|cite|improve this answer









                $endgroup$
















                  0












                  0








                  0





                  $begingroup$

                  There are some areas left vague, the part proving $k$ is not a greatest common divisor of $n$ and $n+2$ (actually this is false, let $k=2$) and showing $2|n$ and $2|n+2$ is impossible.



                  Part 1: you need to add that $k>2$ or else the statement is false, and show why the statement is true for $k>2$. You can show that for $nequiv 0mod k$ and $n+2equiv 0mod k$, we can convert the statements to $0equiv -nmod k$ and $2equiv -nmod k$ and since $-nequiv 0mod k$, the statements become $2equiv0mod k$ (we can ignore $0equiv0mod k$ since that is true for all $k$ and is redundant). We can see that the above statement is not true for $k>2$, so the statement is false.



                  Part 2: Let us define $m$ such that $m=n-1$ if $n$ is odd. Since $2|m$, $nequiv1mod2$ and $n+2equiv3equiv1mod2$. So $2nmid n$ and $2nmid n+2$ for odd $n$. Since Part $1$, when generalized to all values of $k$, involves $nequiv0mod2$, it shows $n+2equiv0mod2$.






                  share|cite|improve this answer









                  $endgroup$



                  There are some areas left vague, the part proving $k$ is not a greatest common divisor of $n$ and $n+2$ (actually this is false, let $k=2$) and showing $2|n$ and $2|n+2$ is impossible.



                  Part 1: you need to add that $k>2$ or else the statement is false, and show why the statement is true for $k>2$. You can show that for $nequiv 0mod k$ and $n+2equiv 0mod k$, we can convert the statements to $0equiv -nmod k$ and $2equiv -nmod k$ and since $-nequiv 0mod k$, the statements become $2equiv0mod k$ (we can ignore $0equiv0mod k$ since that is true for all $k$ and is redundant). We can see that the above statement is not true for $k>2$, so the statement is false.



                  Part 2: Let us define $m$ such that $m=n-1$ if $n$ is odd. Since $2|m$, $nequiv1mod2$ and $n+2equiv3equiv1mod2$. So $2nmid n$ and $2nmid n+2$ for odd $n$. Since Part $1$, when generalized to all values of $k$, involves $nequiv0mod2$, it shows $n+2equiv0mod2$.







                  share|cite|improve this answer












                  share|cite|improve this answer



                  share|cite|improve this answer










                  answered Dec 14 '18 at 3:36









                  KykyKyky

                  460313




                  460313






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Mathematics Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      Use MathJax to format equations. MathJax reference.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3038877%2fprove-gcdn-n2-1-if-n-is-odd-and-2-if-n-is-even%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Ellipse (mathématiques)

                      Quarter-circle Tiles

                      Mont Emei