You are given n>3 rods whose lengths are 1,2,3,.... How many noncongruent triangles can be made using these rods as sides?
This replaces an erroneously programmed version
n number of triangles
4 1
5 3
6 7
7 13
8 22
9 34
10 50
11 70
12 95
13 125
14 161
15 203
16 252
17 308
18 372
19 444
20 525
For n = 4 To 20
ct = 0
For a = 2 To n  2
For b = a + 1 To n  1
For c = b + 1 To n
If c < a + b Then
ct = ct + 1
End If
DoEvents
Next
Next
Next
Text1.Text = Text1.Text & n & Str(ct) & crlf
Next
Edited on July 28, 2019, 3:41 pm

Posted by Charlie
on 20190728 14:41:04 