Prove $gcd(n,n+2)=1$ if $n$ is odd and $2$ if $n$ is even
$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?
elementary-number-theory greatest-common-divisor
$endgroup$
add a comment |
$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?
elementary-number-theory greatest-common-divisor
$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
add a comment |
$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?
elementary-number-theory greatest-common-divisor
$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
elementary-number-theory greatest-common-divisor
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
add a comment |
$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
add a comment |
3 Answers
3
active
oldest
votes
$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.
$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
add a comment |
$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.
$endgroup$
add a comment |
$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$.
$endgroup$
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
$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.
$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
add a comment |
$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.
$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
add a comment |
$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.
$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.
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
add a comment |
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
add a comment |
$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.
$endgroup$
add a comment |
$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.
$endgroup$
add a comment |
$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.
$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.
answered Dec 14 '18 at 3:16
60056005
36.2k751125
36.2k751125
add a comment |
add a comment |
$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$.
$endgroup$
add a comment |
$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$.
$endgroup$
add a comment |
$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$.
$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$.
answered Dec 14 '18 at 3:36
KykyKyky
460313
460313
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
$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