Using number theory to generate the partitions, but too slow for now