If you have a class of 90 students:

Year 1, you want to split them into 2 equal groups

Year 2, 3 equal groups (or near equal)

Year 3, 4 groups

Year 4, 5 groups

Year 5, 6 groups

****The students should not be in the same group as someone they have already been with (as much as possible)

What formula can I use?