We have a triangle with the sides a, b and c where:
/ \ / \ a / \ b / \ / \ /________________\ c
$\ P = a+b+c$
$\ a+b > c$ else it's not a triangle
$\ a,b,c < P$ no side can be negative
P is known and I'm trying to find all integer solutions of (a,b,c).
By plotting $\ c = P - a - b$ we get a plane where a triangle shows all positive solutions. The solutions where $\ a+b > c$ valid is the the bottom part of this triangle. More I don't know.
I'm looking for all solutions, not only the number of solutions. And if $\ P=12 $ I think (3,4,5) and (4,3,5) should be treated like different solutions.
I made an algorithm with C. With help of solutions for a range of vaules for P (See picture) I came up with the following rules:
(note: calling the sides x, y and z now, and now I treat (3,4,5) to be equal with (5,3,4))
Z will vary from (1) to (2)
For a certain Z will X vary from (3) to (4)