I am trying to solve Project Euler problem 86. I know I have to generate Pythagorean triplets and so on. But I have a problem with choosing valid cuboids.
For example if the dimensions of the cuboid are (length, width, height), than for a cuboid with length l = 6, there are three vaild variations, i.e: 6 * 6 * 2, 6 * 5 * 3 and 6 * 4 * 4
Why is 6 * 7 * 1 not a valid cuboid?
You have to count cuboids with integer sides $M\ge a\ge b\ge c\ge1$. The three routes give lengths $\sqrt{a^2+(b+c)^2},\sqrt{b^2+(c+a)^2},\sqrt{c^2+(a+b)^2}$. You only count $(a,b,c)$ if the shortest route is an integer.
Since $a\ge b\ge c$ we have $ab\ge ac\ge bc$ so the shortest length is $\sqrt{a^2+(b+c)^2$.
In the case $a=7,b=6,c=1$ this gives $7\sqrt2$ which is not an integer, so it is not counted.