News for hackers. Stuff that matters.
Re:Ask HN: algorithm to slice a number into parts by RiderOfGiraffes on Wednesday January 21, 2009 @08:09AM (#443158)
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?

There are no comments on this comment yet.