I have a sequence ( n, n-1, n-2,...,1). I need to find numbers in this sequence in this order that somewhat approximately divide it into M parts- within each M subgroup the sum is somewhat the same. Is there a general way to do it?
For example, 5,4,3,2,1 - for M=3, it could be 5; 4; 3,2,1 where the sums are somewhat close (5,4,6). Or 8,7,6,5,4,3,2,1 - For M=3 maybe 8;7+6=13;(rest)15. 8;13;15 is good enough split(15;11;10 is also okay and arguably better than 8,13,15). I don't need it to be exactly equal but for a value of n, M is there a general way to approximately split it? In my case, n is very large( 1000s) and M is probably no greater than 8 at most.