algorithm to slice a number into parts
RiderOfGiraffes: Edit: slices should be of distinct values.You can't do it with positive integers if n<m(m+1)/2, or with non-negative integers if n<m(m-1)/2.  If there is no restriction then there are, again, trivial solutions.Why are you doing this?  As someone else has said, this does smell of homework.  If it is homework, then tell us what you've tried.  If it isn't, then tell us what it's for.You continue to underspecify your problem.  What are you trying to achieve?