Question: How many triangles with integral side lengths are possible, provided their perimeter is 36 units?

I am trying write a code for this question at here

but I got the wrong answer. This is my code.

L := []; 
for a to 18 do
 for b to 18 do 
for c to 18 do 
if a < b+c and b < a+c and c < b+a and a > abs(b-c) and b > abs(a-c) and c > abs(a-b) and a+b+c = 36 then
 L := [op(L), [a, b, c]] end if end do end do end do;

I got 136 triangles. This is a wrong answer. How can I repair my code?

Please Wait...