Modified accel asc algorithm
I wanted to make an accel asc algorithm that only outputs partitions that only have terms that are smaller than or equal to n. For example: if I want the partitions of 4, and n = 2, the wanted partitions are: (2,2),(2,1,1),(1,1,1,1).
This could be easily done by generating all of them then we just have to filter out the unwanted partitions, but that is too slow. I want this to be as efficient as possible. Can the algorithm itself be modified somehow so it doesnt even generate the unwanted partitions?
Here is the said algorithm: