# No. of isosceles triangles possible of integer sides with sides $\leq n$

Prove that the no. of isosceles triangles with integer sides, no sides exceeding $n$ is $\frac{1}{4}(3n^2+1)$ or $\frac{3}{4}(n^2)$ according as n is odd or even, n is any integer.

How to do it? I found that under these conditions no. of triangles possible may be ${n\choose 2}$

• Would you include the triangle $1,1,1$ which is equilateral ? Would you include the triangle $1,1,2$ which is flat ? Have you checked your formulea for small values of $n$ ? – Donald Splutterwit Sep 24 '17 at 16:38
• $n \choose 2$ includes "triangles" where the equal sides are less than half n, and the base side is greater or equal to twice the equal sides. Such a "triangle" is impossible. – fleablood Sep 24 '17 at 16:52
• Related: Crilly, Tony, How to play the triangle game. Math. Gaz. 101 (2017), no. 550, cambridge.org/core/journals/mathematical-gazette/article/… – Ethan Bolker Sep 24 '17 at 16:59
• I just wanted to say this is a really nice excercise, I enjoyed solving it. My solution looks to much like one of the ones given beneith, so I will not post it as an answer. – M. Van Sep 24 '17 at 21:41
• Maybe it's worth posting it anyway though. – M. Van Sep 24 '17 at 21:53

Fix the length of the two equal sides, say $k$. In how many ways can you choose the length of the base $b(k)$? Obviously $b(k) \ge 1$ and, for the triangle inequality, $b(k) < 2k$. But, since no side can exceed $n$, $b(k) \le n$. Putting these things together, we conclude that:

• when $2k - 1 \le n$, that is, when $\displaystyle k \le \left\lfloor\frac{n+ 1}{2}\right\rfloor$, $b(k)$ can range from $1$ to $2k - 1$ inclusive;
• when $2k - 1 > n$, which means $k > \left\lfloor\frac{n + 1}{2}\right\rfloor$, $b(k)$ can range from $1$ to $n$ inclusive.

Hence the total number of isosceles triangles is $$\sum_{k = 1}^n b(k) = \sum_{k = 1}^{\left\lfloor\frac{n + 1}{2}\right\rfloor} (2k - 1) + \sum_{k = \left\lfloor\frac{n + 1}{2}\right\rfloor + 1}^n n = \left\lfloor\frac{n + 1}{2}\right\rfloor^2 + n\left(n - \left\lfloor\frac{n + 1}{2}\right\rfloor\right)$$ Now when $n$ is odd $\displaystyle \left\lfloor\frac{n + 1}{2}\right\rfloor = \frac{n + 1}{2}$, so the expression above reduces to $$\left(\frac{n + 1}{2}\right)^2 + n\left(n - \frac{n + 1}{2}\right) = \frac{n^2 + 2n + 1 + 4n^2 - 2n^2 - 2n}{4} = \boxed{\frac{3n^2 + 1}{4}}$$ while, when $n$ is even, $\displaystyle \left\lfloor\frac{n + 1}{2}\right\rfloor = \frac{n}{2}$ and the formula is $$\left(\frac{n}{2}\right)^2 + n\left(n - \frac{n}{2}\right) = \frac{n^2 + 4n^2 - 2n^2}{4} = \boxed{\frac{3n^2}{4}}$$

• You could add for clarity that any choice of $b(k)$ such that $b(k)<2k$ gives an isosceles triangle (you can use pythagoras for this, or a picture). – M. Van Sep 24 '17 at 21:46
• Why did you choose $2k-1$? in $2k - 1\le n$ – Abcd Dec 31 '17 at 15:13

Hint: Break it up into cases based on the repeated side, and don't forget about equilateral triangles or the triangle inequality!

• Repeated sides can be accounted for but how to use inequalities while permuting or combining – sayan Sep 24 '17 at 16:51

${n \choose 2}$ is the number of triplets $(k,k, m)$. But not all triplets can be triangles. To be a triangle i) $m < k + k = 2k$ and ii) $k < k + m$. (i) is a essential, ii) is trivially redundant).

So we need to find all possible triplets $(k,k,m)$ where $k,m \le n$ and $m < 2k$. As $m$ is an integer, that means $m \le 2k-1$ and $m \le n$.

That is $\sum_{k=1}^n\sum_{m=1}^{\min (n, 2k - 1)}1=\sum_{k=1}^n{\min (n, 2k - 1)}$

$\sum_{k= 1; k \le \frac n2} (\min (n, 2k - 1)) + \sum_{k> \frac n2}^n(\min(n,2k-1)) =$

$\sum_{k=1; k \le \frac n2} (2k-1) + \sum_{k>\frac n2}^n n$

Case 1: $n$ is even

$= [\sum_{k=1}^{\frac n2}(2k-1)] + [\sum_{k=\frac n2 + 1}^n n]$

$=[(\frac n2)^2] + [\frac n2*n]$

$=\frac 34n^2$.

Case 2: $n$ is odd

$= [\sum_{k=1}^{\frac {n-1}2}(2k-1)] + [\sum_{k=\frac {n+1}2 }^n n]$

$=[(\frac {n-1}2)^2] + [\frac {n+1}2*n]$

$=\frac {(n^2 - 2n + 1)+ (2n^2 + 2n)}4 = \frac 14(3n^2 + 1)$

.....

Example $n = 10$.

Now we need to find all possible $(k,k,m)$ so that $k,m \le 10$ and $m < 2k$.

If $k =1$ then $m$ may be $1$. Total: $1$ way.

If $k=2$ then $m$ may be $1,2,3$. Total: $3$ + $1$ = $4$ ways.

If $k=3$ then $m$ may be $1...5$. Total: $5+3+1=9$ ways.

If $k=4$ then $m$ may be $1... 7$. Total: $7+5+3+1=16$ ways.

If $k = 5$ then $m$ may be $1....9$. Total: $9 + 7+ ..... + 1 = 25$ ways.

If $k = 6$ then $m$ may be $1....10$. Total: $10 + 25 = 35$ ways.

If $k = 7$ then $m$ may be $1..... 10$. Total: $10 + 10 + 25 = 45$ ways.

If $k = 8 .... 10$ then $m$ may be $1.... 10$. Total $10 + 10 + ..... + 10 + 25$ ways.

Total number of ways: $1 + 3 + 5+ 7 + +9 + 10+10+10 + 10+10 = 75$

For $n$ even we will have

$(1 + 3 + 5 + ..... + (2*(\frac n2)-1) + (n + n + n + .....n) =$

$(\frac n2)^2 + \frac n2*n = \frac 34 n^2$.

If $n$ is odd we will have.

$(1 + 3 + 5 + ..... + (2*(\frac {n-1}2) - 1) + (n+n+n .... +n) =$

$(\frac {n-1{2)^2 + \frac {n+1} 2*n = \frac 14(3n^2 + 1)$.

• Why are you taking $2k-1$?? – sayan Sep 24 '17 at 17:20
• $2k-1$ is the maximum value $m$ can be. If $m = 2k$ then you have a flat triangle. If $m > 2k$ you break the triangle inequality. So $m < 2k$. But $m$ is an integer so $m \le 2k-1$. – fleablood Sep 24 '17 at 17:23
• @fleeable You are using summation. Summation is the sum of what in this problem??How are you getting no. Of options using summation – sayan Sep 24 '17 at 18:26
• I am adding up the number of ways to do triangles. if $k=1$. There is one way. $(1,1,1)$. Then I add the number of ways if $k = 2$. There are three ways. $(2,2,1)(2,2,2$ and $(2,2,3)$. Then I add the number of ways if $k = 3$. There arethree ways. $(3,3,1)(3,3,,2)$ and $(3,3,3)$. then I add the ways if $k$ is 4, if $k$ is $5$ and so on up to if $k$ is $n$. If $k<\frac n2$ then $m$ can be anything between $1$ to $2k-1$ and there are $2k-1$ such triangles. If $k \ge n2$ then $m$ can be anything up to $n$ and there are $n$ such triangles. – fleablood Sep 24 '17 at 19:29

First note that the number of isosceles triangles with equal lengths $j$ and base lengths $k$ is the same as the number of right angled triangles with hypothenuse $j$ and one fixed side equal to $k/2$, drop a perpendicular bisector from the top of the triangle to see this. So for $j \in \{1,...,n\}$we just need to count the number $s_j$ of $k$'s with $1 \leq k \leq n$ for which $$j^2=(k/2)^2+s^2$$ has a positive solution $s \in \mathbb{R}$, and add all these $s_j$'s . The above equation has a solution if and only if $k<2j$. This gives $$s_j=\min\{2j-1, n\},$$ which is $n$ if $j\geq \frac{n+1}{2}$, and $2j-1$ else. So for $n$ odd we get for the total number $$\sum_{j=1}^n s_j=\sum_{j=1}^{\frac{n-1}{2}} (2j-1) +\sum_{j=\frac{n+1}{2}}^n n,$$ and for $n$ even we get a total number $$\sum_{j=1}^n s_j = \sum_{j=1}^{\frac{n}{2}} (2j-1) +\sum_{j=\frac{n+2}{2}}^n n$$ which I'm sure you can both evaluate using gauss' formula for the sum of consecutive numbers starting from $1$.