What is a byes? I had assumed it was a term you used to simply remove an odd number, but this makes it sound more like a technical term.
Its not a hard problem, its simply a couple of loops. But like I said, you simply don't conform to standard mathematics, so you cannot rely directly on combination calculations. With 8 teams you'll simply end up with either a remainder of 12 or a shortage of 16 games to play. You just can't divide into this number to end up with an even result; there will be overlap but you need to dictate the rules to calculate the overlap.