A surprising counting problem connects elementary geometry, integer partitions, and lattice points.
A smaller perimeter can give more triangles
Suppose we have a supply of sticks whose lengths are positive integers. We want to build triangles with a prescribed perimeter. How many genuinely different triangles can we make?
Two triangles are considered the same if they have the same three side lengths, regardless of the order in which those lengths are written. Thus, the triples (3,4,5), (4,3,5), and (5,4,3) all describe one triangle.
Here is the surprise: there are 310 different integer-sided triangles with perimeter 119, but only 300 with perimeter 120. Increasing the available perimeter by one can actually decrease the number of possibilities!
This observation appears in a 1979 paper by J. H. Jordan, Ray Walch, and R. J. Wisner in The American Mathematical Monthly. We will develop an elementary way to understand it.
Step 1: Translate geometry into inequalities
Write the three sides in nondecreasing order:
a\le b\le c,\qquad a+b+c=N.Ordering the sides ensures that each triangle is counted only once. Since the sum of any two sides of a nondegenerate triangle must exceed the third, and c is the largest side, it is enough to require
a+b>c.Using a + b = N – c, the triangle inequality becomes:
N – c > c, which is equivalent to c < N/2.
Key observation: An ordered triple of positive integers with perimeter N forms a triangle precisely when its largest side is strictly less than half the perimeter.
Step 2: A complete example with perimeter 12
Let N=12. Since c<6, the largest side can be at most 5. The complete list is:
| Side lengths | Type |
|---|---|
(2,5,5) |
Isosceles |
(3,4,5) |
Scalene, right |
(4,4,4) |
Equilateral |
Therefore, if T(N) denotes the number of incongruent integer-sided triangles with perimeter N, then
T(12)=3.
Notice that (1,5,6) does not count: its two shorter sides add up to the longest side, so it is a straight segment rather than a triangle.
Step 3: Count systematically instead of making lists
Choose the shortest side a. Since a ≤ b ≤ c, we necessarily have
1\le a\le\left\lfloor\frac N3\right\rfloor.
Once a and b are chosen, the third side is determined:
c=N-a-b.
What values of b are possible? The condition a ≤ b gives one lower bound. The triangle inequality gives another:
a+b>N-a-b\quad\Longleftrightarrow\quad b>\frac N2-a.
Because b is an integer, the smallest permissible value is
L(a)=\max\left\{a,\left\lfloor\frac N2\right\rfloor-a+1\right\}.
Finally, the ordering condition b ≤ c means
b\le N-a-b\quad\Longleftrightarrow\quad b\le\left\lfloor\frac{N-a}{2}\right\rfloor.
Thus the largest possible value is
U(a)=\left\lfloor\frac{N-a}{2}\right\rfloor.
For each fixed a, the number of valid choices for b is
\max\{0,U(a)-L(a)+1\}.
We obtain an exact formula valid for every positive integer N:
\boxed{T(N)=\sum_{a=1}^{\lfloor N/3\rfloor}\max\left\{0,\left\lfloor\frac{N-a}{2}\right\rfloor-\max\left(a,\left\lfloor\frac N2\right\rfloor-a+1\right)+1\right\}.}
Although the formula looks complicated, every term simply counts integers in an interval. It replaces a potentially long search through triples with a short sum.
Step 4: A beautiful correspondence between different perimeters
The 1979 paper proves the following striking identity:
\boxed{T(N)=T(N-3)\qquad\text{for even }N\ge 8.}
Why should subtracting three from the perimeter preserve the number of triangles?
Start with an integer-sided triangle (a,b,c) of even perimeter N, where a ≤ b ≤ c. Subtract 1 from each side:
(a,b,c)\longmapsto(a-1,b-1,c-1).
First, the shortest side cannot be 1. Indeed, if a=1, then b ≤ c and the triangle inequality force c=b. But the perimeter 1+2b would be odd, contrary to our assumption. Hence a ≥ 2, and all three new side lengths remain positive.
Next, the triangle inequality remains true. Since a+b-c is a positive even integer (it has the same parity as the even perimeter N), we know
a+b-c\ge2.
After subtracting 1 from every side, the new triangle inequality reads
(a-1)+(b-1)>(c-1),
which is equivalent to a+b-c>1, and that follows from the preceding inequality.
Conversely, adding 1 to every side of any triangle of odd perimeter N-3 produces a triangle of even perimeter N. The two operations undo each other, giving a one-to-one correspondence.
For example, the three triangles of perimeter 12 correspond exactly to these three triangles of perimeter 9:
| Perimeter 12 | Subtract 1 from each side | Perimeter 9 |
|---|---|---|
(2,5,5) |
→ | (1,4,4) |
(3,4,5) |
→ | (2,3,4) |
(4,4,4) |
→ | (3,3,3) |
Therefore T(12)=T(9)=3. This is a good example of a bijection: instead of counting two sets separately, we pair their elements perfectly.
Step 5: The pattern for larger perimeters
Here are some values obtained from the counting formula:
Perimeter N |
Number T(N) |
|---|---|
| 9 | 3 |
| 12 | 3 |
| 15 | 7 |
| 20 | 8 |
| 119 | 310 |
| 120 | 300 |
For even perimeters, Jordan, Walch, and Wisner also established the recurrence
\boxed{T(N+12)=T(N)+\frac N2+3\qquad(N\text{ even},\ N\ge 6).}
For example, since T(12)=3, we get
T(24)=T(12)+6+3=12.
Applying the recurrence repeatedly gives a quadratic growth pattern along each even residue class modulo 12. In fact, the total number of triangles grows approximately as
T(N)\mathrel{\sim}\frac{N^2}{48}\qquad(N\to\infty)The notation \sim means asymptotic equivalence. that the ratio of the two expressions approaches 1. So doubling a large perimeter produces approximately four times as many triangles, even though neighboring perimeters can have unexpectedly different counts.
Step 6: Where lattice points enter the picture
There is a geometric way to view the counting problem. Because c=N-a-b, every triangle corresponds to an integer lattice point (a,b) in the plane. The allowed points satisfy
a\ge 1,\quad b\ge a,\quad 2b\le N-a,\quad 2(a+b)>N.
These inequalities cut out a polygonal region. Counting integer-sided triangles is exactly the same as counting lattice points inside that region, with the appropriate boundary points included or excluded.
This explains why quadratic formulas appear: when the perimeter grows, the region expands in two dimensions, and its number of lattice points grows roughly like its area. The floor functions in our exact formula record the small changes caused by the integer grid.
Going further: how many triangles are acute?
The original counting problem treats all triangles alike. But what happens if we separate them by angle type?
For ordered sides a ≤ b ≤ c, the converse of the Pythagorean theorem tells us that a triangle is
- Acute if a^2+b^2>c^2.
- Right if a^2+b^2=c^2.
- Obtuse if a^2+b^2<c^2.
Let A(N), R(N), and O(N) count these three types. Then
T(N)=A(N)+R(N)+O(N).
For perimeter 12, the three possibilities are (2,5,5), which is acute; (3,4,5), which is right; and (4,4,4), which is acute. Thus
A(12)=2,\qquad R(12)=1,\qquad O(12)=0.
A question for the reader: Among all integer-sided triangles with a very large fixed perimeter, what fraction are acute? Does that fraction approach a limit?
We will return to this question in a future article. It leads naturally from elementary triangle geometry to counting lattice points near a curved boundary.
Final thought
A simple question about sticks of integer lengths has led us through triangle inequalities, counting formulas, bijections, recurrences, and geometric lattice-point problems. The most interesting lesson may be that counting geometric objects is often easier after finding the right coordinates and the right correspondence.
Continue exploring: Among all triangles with the same perimeter, which has the largest area? See Why the Equilateral Triangle Wins: Maximum Area for a Fixed Perimeter.
Reference
J. H. Jordan, Ray Walch, and R. J. Wisner, “Triangles with Integer Sides,” The American Mathematical Monthly, vol. 86, no. 8 (1979), pp. 686–689. View the original paper on JSTOR.
More triangle geometry:
Another surprisingly difficult question is whether a circle
can divide a triangle into two regions of equal area.
Explore this problem in our article
Can a Circle Cut a Triangle in Half?.
Further reading:
What special relationships hold between the sides,
area, and perimeter of a right triangle?
Explore these surprising identities in our article
The Hidden Mathematics of Right Triangles: Sides, Area, and Perimeter.

Leave a Reply