I have this code for evaluating some fractions:
fmax = 100;
Do[
If[GCD[f, g, h] != 1, Continue[]];
If[Mod[f^2 + g^2 + h^2, f g + g h + h f] == 0, Print[(f g+g h+h f)/(f^2+g^2+h^2)]],
{f, fmax}, {g, f + 1, fmax + 1}, {h, g + 1, fmax + 2}
]
However, I want to stop it from evaluating the same fraction twice (there are a lot of $\frac{1}{2}$'s appearing, but I only need one of each possible fraction).
Is there an easy way to modify the code to do this?
If not, how can I just make sure that NO $\frac{1}{2}$'s appear. That would be just as helpful if you can show me how to do it.
Thanks!
