TOPICS
Search

Triangle Counting


Triangle counting in this problem asks for the number T(n) of nondegenerate triangles that can be formed by choosing three distinct rods from one rod of each length 1, 2, ..., n, where n>=1 is an integer. Each choice of three rods is counted once. If the largest length l_i and the other two lengths l_j and l_k satisfy

 l_i>=l_j+l_k
(1)

then the rods do not form a nondegenerate triangle. All other choices satisfy the triangle inequality and do form a triangle. The answer is

 T(n)={1/(24)n(n-2)(2n-5)   for n even; 1/(24)(n-1)(n-3)(2n-1)   for n odd.
(2)

The values for n=1, 2, ... are 0, 0, 0, 1, 3, 7, 13, 22, 34, 50, ... (OEIS A002623, with T(n)=a(n-4) for n>=4). The ordinary generating function f(x)=sum_(n=1)^(infty)T(n)x^n is

 f(x)=(x^4)/((1-x)^3(1-x^2))=x^4+3x^5+7x^6+13x^7+...
(3)

for |x|<1.


See also

Triangle Tiling

Explore with Wolfram|Alpha

References

Honsberger, R. More Mathematical Morsels. Washington, DC: Math. Assoc. Amer., pp. 278-282, 1991.Sloane, N. J. A. Sequence A002623/M2640 in "The On-Line Encyclopedia of Integer Sequences."

Referenced on Wolfram|Alpha

Triangle Counting

Cite this as:

Weisstein, Eric W. "Triangle Counting." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/TriangleCounting.html

Subject classifications