Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose $a,b,c \in\mathbb N$, and the value of $c$ is known and fixed, while $a$ and $b$ are unknown and are both smaller than $c$. What is the total number of unique triangles possible with $a, b$ and $c$ as its sides?

share|cite|improve this question
Do you mean the natural numbers? Does "known" mean "fixed" and "unknown" mean "variable" (in which case you should not mention $a,b$ in the final question)? And can there be more than one triangle with given sides $a,b,c$? (Under the usual definition there can, for instance realted by translation or rotation, but the 'combinatorics' tag suggests you do not mean that.) In short, please reformulate the question more carefully so people can figure out what you are asking. – Marc van Leeuwen Aug 15 '12 at 15:20
Unless there are some other conditions, there are an infinite number of possible triangles (assuming $n>1$): just take the sides to be n, n+k and n+k+1 for any positive integer k. – Old John Aug 15 '12 at 15:20
@Old John : Apologies. – Swapnanil Saha Aug 15 '12 at 15:25
No problems! - The question looks more interesting now. – Old John Aug 15 '12 at 15:27
Should degenerate triangles be counted as well? – celtschk Aug 15 '12 at 15:28
up vote 5 down vote accepted

What is the total number of unique triangles possible with $a$, $b$ and $c$ as its sides?

The formula you need is $$\left\lfloor\frac{(c-1)^2}{4}\right\rfloor$$

As noted here, it counts "the number of noncongruent integer-sided triangles with largest side $c$". See this article as well.

share|cite|improve this answer
Won't this overcount because it allows $a,b$ to equal $c$, while the poster asks for $a,b$ smaller than $c$? Not that it would be hard to exclude those cases... – hardmath Aug 15 '12 at 16:07
No, it does not. $c=1$ and $c=2$ are $0$ for obvious reasons. For $c=3$, you only have $1$ triangle ($(2,2,3)$), which matches with the formula's result. For $c=4$, you have $(2,3,4)$ and $(3,3,4)$, which gives $2$ triangles... you can go on and check. The article I linked to gives a derivation for an alternative formula. – J. M. Aug 15 '12 at 16:10
Anyway, I suppose I should have said my point: OP should have tried out a few cases and then checked out the OEIS. – J. M. Aug 15 '12 at 16:17
Your formula is correct, as is the OEIS comment about "triangles with largest side $c$". The extra triangles, allowing $b=c$, number $c$, corresponding to $a = 1,\ldots,c$. But this is precisely the difference between your $\lfloor \frac{(c-1)^2}{4} \rfloor$ and the quantity $\lfloor \frac{(c+1)^2}{4} \rfloor$ commented on in the OEIS. – hardmath Aug 17 '12 at 13:28

Depending on whether you consider $(a,b,c)=(3,4,5)$ to give a different triangle from $(a,b,c)=(4,3,5)$, you seem to be either asking for the number of elements in $$ \{\,(a,b)\in\mathbb N^2\mid 0<a< n \text{ and } 0<b, n \text{ and } a+b>n\,\} $$ or for the number of elements in $$ \{\,(a,b)\in\mathbb N^2\mid 0<a\leq b< n \text{ and } a+b>n\,\}. $$ Surely you can find the answers to these easy questions? Make a drawing of dots inside a square if you need to.

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.