Partition list on a number