How many ways can a number be written as a sum of two non negative integers?












0












$begingroup$


How many ways can a number be written as a sum of two non negative integers?



For example there is $4$ way for $7$. $ 7=0+7=1+6=2+5=3+4$



I think there is $[ frac{N}{2}]+1$ way for number$N$. Is it true?










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Your example shows your rule does not work. Also $0$ is not positive so $0+7$ should not count.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:46












  • $begingroup$
    @Ross Millikan, yes. I forgot to divide by 2. And I use nonnegative numbers. Thanks for your note.
    $endgroup$
    – ilen
    Dec 11 '18 at 5:58
















0












$begingroup$


How many ways can a number be written as a sum of two non negative integers?



For example there is $4$ way for $7$. $ 7=0+7=1+6=2+5=3+4$



I think there is $[ frac{N}{2}]+1$ way for number$N$. Is it true?










share|cite|improve this question











$endgroup$








  • 1




    $begingroup$
    Your example shows your rule does not work. Also $0$ is not positive so $0+7$ should not count.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:46












  • $begingroup$
    @Ross Millikan, yes. I forgot to divide by 2. And I use nonnegative numbers. Thanks for your note.
    $endgroup$
    – ilen
    Dec 11 '18 at 5:58














0












0








0





$begingroup$


How many ways can a number be written as a sum of two non negative integers?



For example there is $4$ way for $7$. $ 7=0+7=1+6=2+5=3+4$



I think there is $[ frac{N}{2}]+1$ way for number$N$. Is it true?










share|cite|improve this question











$endgroup$




How many ways can a number be written as a sum of two non negative integers?



For example there is $4$ way for $7$. $ 7=0+7=1+6=2+5=3+4$



I think there is $[ frac{N}{2}]+1$ way for number$N$. Is it true?







combinatorics combinations






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Dec 11 '18 at 6:06







ilen

















asked Dec 11 '18 at 5:42









ilenilen

226




226








  • 1




    $begingroup$
    Your example shows your rule does not work. Also $0$ is not positive so $0+7$ should not count.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:46












  • $begingroup$
    @Ross Millikan, yes. I forgot to divide by 2. And I use nonnegative numbers. Thanks for your note.
    $endgroup$
    – ilen
    Dec 11 '18 at 5:58














  • 1




    $begingroup$
    Your example shows your rule does not work. Also $0$ is not positive so $0+7$ should not count.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:46












  • $begingroup$
    @Ross Millikan, yes. I forgot to divide by 2. And I use nonnegative numbers. Thanks for your note.
    $endgroup$
    – ilen
    Dec 11 '18 at 5:58








1




1




$begingroup$
Your example shows your rule does not work. Also $0$ is not positive so $0+7$ should not count.
$endgroup$
– Ross Millikan
Dec 11 '18 at 5:46






$begingroup$
Your example shows your rule does not work. Also $0$ is not positive so $0+7$ should not count.
$endgroup$
– Ross Millikan
Dec 11 '18 at 5:46














$begingroup$
@Ross Millikan, yes. I forgot to divide by 2. And I use nonnegative numbers. Thanks for your note.
$endgroup$
– ilen
Dec 11 '18 at 5:58




$begingroup$
@Ross Millikan, yes. I forgot to divide by 2. And I use nonnegative numbers. Thanks for your note.
$endgroup$
– ilen
Dec 11 '18 at 5:58










1 Answer
1






active

oldest

votes


















1












$begingroup$

If you consider 3+4 and 4+3 as two different ways then yes it will be N+1. Think of it as placing a partition in a row of N objects you can place it right in the beginning, right at the end and any of the N-1 locations. However if 3+4 and 4+3 are considered same then we have only 4 ways of writing 7 as sum of two numbers. In this case the answer will be ceil((N+1)/2) where ceil(x) is smallest integer greater is Han or equal to x.






share|cite|improve this answer











$endgroup$









  • 1




    $begingroup$
    No, because we are talking of positive integers. $0$ is not allowed. You have a typo with Han at the end.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:55








  • 1




    $begingroup$
    Yes I have requested an edit in question changing positive to negative. As seen in example 0+7 is seen as a valid breakup
    $endgroup$
    – Curious
    Dec 11 '18 at 5:57










  • $begingroup$
    Thanks for correcting that was a typo I will edit
    $endgroup$
    – Curious
    Dec 11 '18 at 6:09












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%2f3034937%2fhow-many-ways-can-a-number-be-written-as-a-sum-of-two-non-negative-integers%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1












$begingroup$

If you consider 3+4 and 4+3 as two different ways then yes it will be N+1. Think of it as placing a partition in a row of N objects you can place it right in the beginning, right at the end and any of the N-1 locations. However if 3+4 and 4+3 are considered same then we have only 4 ways of writing 7 as sum of two numbers. In this case the answer will be ceil((N+1)/2) where ceil(x) is smallest integer greater is Han or equal to x.






share|cite|improve this answer











$endgroup$









  • 1




    $begingroup$
    No, because we are talking of positive integers. $0$ is not allowed. You have a typo with Han at the end.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:55








  • 1




    $begingroup$
    Yes I have requested an edit in question changing positive to negative. As seen in example 0+7 is seen as a valid breakup
    $endgroup$
    – Curious
    Dec 11 '18 at 5:57










  • $begingroup$
    Thanks for correcting that was a typo I will edit
    $endgroup$
    – Curious
    Dec 11 '18 at 6:09
















1












$begingroup$

If you consider 3+4 and 4+3 as two different ways then yes it will be N+1. Think of it as placing a partition in a row of N objects you can place it right in the beginning, right at the end and any of the N-1 locations. However if 3+4 and 4+3 are considered same then we have only 4 ways of writing 7 as sum of two numbers. In this case the answer will be ceil((N+1)/2) where ceil(x) is smallest integer greater is Han or equal to x.






share|cite|improve this answer











$endgroup$









  • 1




    $begingroup$
    No, because we are talking of positive integers. $0$ is not allowed. You have a typo with Han at the end.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:55








  • 1




    $begingroup$
    Yes I have requested an edit in question changing positive to negative. As seen in example 0+7 is seen as a valid breakup
    $endgroup$
    – Curious
    Dec 11 '18 at 5:57










  • $begingroup$
    Thanks for correcting that was a typo I will edit
    $endgroup$
    – Curious
    Dec 11 '18 at 6:09














1












1








1





$begingroup$

If you consider 3+4 and 4+3 as two different ways then yes it will be N+1. Think of it as placing a partition in a row of N objects you can place it right in the beginning, right at the end and any of the N-1 locations. However if 3+4 and 4+3 are considered same then we have only 4 ways of writing 7 as sum of two numbers. In this case the answer will be ceil((N+1)/2) where ceil(x) is smallest integer greater is Han or equal to x.






share|cite|improve this answer











$endgroup$



If you consider 3+4 and 4+3 as two different ways then yes it will be N+1. Think of it as placing a partition in a row of N objects you can place it right in the beginning, right at the end and any of the N-1 locations. However if 3+4 and 4+3 are considered same then we have only 4 ways of writing 7 as sum of two numbers. In this case the answer will be ceil((N+1)/2) where ceil(x) is smallest integer greater is Han or equal to x.







share|cite|improve this answer














share|cite|improve this answer



share|cite|improve this answer








edited Dec 11 '18 at 6:09

























answered Dec 11 '18 at 5:52









CuriousCurious

889516




889516








  • 1




    $begingroup$
    No, because we are talking of positive integers. $0$ is not allowed. You have a typo with Han at the end.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:55








  • 1




    $begingroup$
    Yes I have requested an edit in question changing positive to negative. As seen in example 0+7 is seen as a valid breakup
    $endgroup$
    – Curious
    Dec 11 '18 at 5:57










  • $begingroup$
    Thanks for correcting that was a typo I will edit
    $endgroup$
    – Curious
    Dec 11 '18 at 6:09














  • 1




    $begingroup$
    No, because we are talking of positive integers. $0$ is not allowed. You have a typo with Han at the end.
    $endgroup$
    – Ross Millikan
    Dec 11 '18 at 5:55








  • 1




    $begingroup$
    Yes I have requested an edit in question changing positive to negative. As seen in example 0+7 is seen as a valid breakup
    $endgroup$
    – Curious
    Dec 11 '18 at 5:57










  • $begingroup$
    Thanks for correcting that was a typo I will edit
    $endgroup$
    – Curious
    Dec 11 '18 at 6:09








1




1




$begingroup$
No, because we are talking of positive integers. $0$ is not allowed. You have a typo with Han at the end.
$endgroup$
– Ross Millikan
Dec 11 '18 at 5:55






$begingroup$
No, because we are talking of positive integers. $0$ is not allowed. You have a typo with Han at the end.
$endgroup$
– Ross Millikan
Dec 11 '18 at 5:55






1




1




$begingroup$
Yes I have requested an edit in question changing positive to negative. As seen in example 0+7 is seen as a valid breakup
$endgroup$
– Curious
Dec 11 '18 at 5:57




$begingroup$
Yes I have requested an edit in question changing positive to negative. As seen in example 0+7 is seen as a valid breakup
$endgroup$
– Curious
Dec 11 '18 at 5:57












$begingroup$
Thanks for correcting that was a typo I will edit
$endgroup$
– Curious
Dec 11 '18 at 6:09




$begingroup$
Thanks for correcting that was a typo I will edit
$endgroup$
– Curious
Dec 11 '18 at 6:09


















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%2f3034937%2fhow-many-ways-can-a-number-be-written-as-a-sum-of-two-non-negative-integers%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

How to change which sound is reproduced for terminal bell?

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Can I use Tabulator js library in my java Spring + Thymeleaf project?