# Integer Triangles with Perimeter $n$

How many triangles are possible with positive integer side lengths for perimeter $n$?

My attempt so far has been bashing for $n=1,\; 2, \cdots , 13$ and calculating how many triangles are possible for those specific $n$'s. I found a pattern for when $n$ is odd or even, but haven't really been able to do much more than that.

I think I it would be useful to assume for a triangle $\left ( a,b,c\right )$ that $$a \leq b \leq c$$ to avoid over counting.

• Hint: Assuming $a \leq b \leq c$, a triangle of side lengths $(a,b,c)$ exists iff $a+b \geq c$. – JoeyBF Jun 13 '14 at 14:42
• Excluding flat triangles and using your convention, all triples such that $a+b>c$ are possible. With $a+b+c=n$, this gives $2(a+b)>n$. – Yves Daoust Jun 13 '14 at 14:43

## 2 Answers

HINT: Let $a,b,c$ denote the lengths of the sides of the triangle. Then we should have $$a+b>c\quad\mbox{and}\quad a+b+c=n.$$ The above two equations implies $a+b-c=n-2c>0$, i.e. $c<n/2$ and similarly $a,b<n/2$. So you need to count the number of triples $(a,b,c)$ such that $0<a\leq b\leq c$ and $a,b,c<n/2$.

EDIT: Note that you only need to find the number of tuples $(a,b)$ such that $0<a\leq b$ and $a,b<n/2$, because $c$ is fixed once you specify $a$ and $b$. Let us consider two cases.

Case (i) $n$ is even: For a fixed $a$, you have the following choices for $b$: $a+1, a+2,\cdots ,n/2-1$, that is $n/2-1-a$ choices. Now $a$ can take values $1,2,\ldots ,n/2-1$. So the number of triangles in this case is $$\sum_{a=1}^{n/2-1}(n/2-1-a)=(n/2-2)+(n/2-3)+\cdots +1=\frac{(n/2-2)(n/2-1)}{2}.$$

Case (ii) $n$ is odd: For a fixed $a$, you have the following choices for $b$: $a+1, a+2,\cdots ,(n-1)/2$, that is $(n-1)/2-a$ choices. Now $a$ can take values $1,2,\ldots ,(n-1)/2$. So the number of triangles in this case is $$\sum_{a=1}^{(n-1)/2}((n-1)/2-a)=((n-1)/2-1)+\cdots +1=\frac{((n-1)/2-1)(n-1)/2}{2}.$$

• excluding 0. You would want to add that :) – tpb261 Jun 13 '14 at 14:57
• I think that should be obvious, length of a line segment can not be $0$; anyway, specified. – pritam Jun 13 '14 at 15:04
• Obvious, yes. But it's easy to miss while forming the expressions, at least to me. – tpb261 Jun 13 '14 at 15:05
• @pritam I still haven't been able to fully solve it. Do you mind showing the solution? I'm apparently supposed to arrive at Alcuin's Sequence, but i'm not sure how I would have ever formed that sequence myself. – Ozera Jun 13 '14 at 16:01
• @Ozera: I have completed the answer, have a look. – pritam Jun 14 '14 at 16:56

A bit of looking up gives the sequence A005044

Also, this paper might be of interest.

• A few more references for alucin's sequence: 1. A simple closed form by elementary means 2. Triangles with Integer Sides and Sharing Barrels – talegari Jun 13 '14 at 17:13
• Thanks for the references. – gar Jun 13 '14 at 17:32