Can you just index your inner counters as b = a+1,limit and c=b+1,limit? That would ensure that you would never repeat a triple with b or c less than a, c less than b or a, etc. I programmed it up (in ...
Mathematics Magazine presents articles and notes on undergraduate mathematical topics in a lively expository style that appeals to students and faculty throughout the undergraduate years. The journal ...