Well simplependulum makes it sound easy, but I don't think I'm up for that; I'll try a different approach.

We can look for a recurrence relation; we will express T(n) in terms of T(n-1).

It is easy to verify that T(1)=T(2)=T(3)=0 and T(4)=1. So let's find the recurrence for n>4.

We will reason this way: T(n) - T(n-1) is going to count precisely those triangles that have n as the longest side. Why? Because if the longest side is less than n, then it is already counted in T(n-1). So let's count the triangles that have n as longest side, starting with n=5.

thanks man

thanks mate

S(5)={1,2,3,4,5}

Let's call the shortest side a and the middle side b. Fix b=4=n-1. Then the triangle inequality tells us that

. So possible a are {2,3}. What if we try to fix b=3? Then the inequality becomes

and there are no possible a. So T(5) - T(4) = 2, as expected. (It's expected because we already listed out all the values earlier in this thread.)

Examine S(6)={1,2,3,4,5,6}. Fix b=5. Then a is in {2,3,4}. Fix b=4. Then a is in {3}. So T(6) - T(5) = 4, as expected.

If you continue the pattern you will notice we either have a sum of the form 2 + 4 + ... + (n-3) if n is odd or 1 + 3 + ... + (n-3) if n is even. So

if n odd, write n=2k+1, and we have

and if n even, write n=2k, and we have

So altogether we have

You could type this into PARI/GP as

Code:

T(n)=if(n<4,0,if(n==4,1,if(n%2==1,T(n-1)+floor(n/2)*(floor(n/2)-1),T(n-1)+(n/2-1)^2)))

Possibly this result could be used for an inductive proof of simplependulum's formula.