The Frozen Wasteland QAR sequencer module has algorithm that evenly spaces n events in m time.

I’d like to find a code example of that ‘even spread’ algorithm, for another application:

I have a scale generator that permutes the N prime numbers into fractions. I’d like to ‘thin’ the scale by picking (for example) 21 evenly spaced values from a table of 37 values.

I can go back to the Euclidean sequencer academic papers if I have to but this sounds like a problem someone already solved, so if you know of a good solution, let me know.