in reply to Split range 0 to M into N non-overlapping (roughly equal) ranges.

<smart-butt response>

perl -slwE 'say $_ for 0..$N-2; printf "from %d to %d\n", $N-1, $M' -- -N=5 -M=9999997

Sorry, couldn't help myself.

Good Day,
    Dean