| I'll assume, like Chuck, that triangles can be turned over, so we want
the number of ordered triplets that form a triangle with max side n.
This can be done in two stages: first find the number of triangles
whose largest side has length r, then sum from r = 1 to n.
For the first stage the answer depends whether r is odd or even.
If r = 2s then we get
2s + 2s-2 + 2s-4 + ... + 2 = s(s+1)
If r = 2s-1 then we get
2s-1 + 2s-3 + 2s-5 + ... + 1 = s�
So if n = 2t we want the sum
Sigma(1 to t)[s�] + Sigma(1 to t)[s(s+1)] = t(t+1)(4t+5)/6
(several tedious steps left out here - I can never remember the
formula for sum of squares and I have to work it out from first
principles every time)
and if n = 2t-1 we want the sum
Sigma(1 to t)[s�] + Sigma(1 to t-1)[s(s+1)] = t(t+1)(4t-1)/6
which seems to agree with Chuck's list. And with a bit of trickery the
two could be combined.
An alternative method would be to spot that the third differences in
the table go 0,1,0,1,0,1,... so assume it's a cubic for the odd and
even cases, solve for the coefficients and then go for induction to
verify it.
Dick
|