Rosetta Code - Farey sequence tests


The Farey sequence problem seen at explains to us that it’s a “sequence of completely reduced fractions between 0 and 1 which, when in lowest terms, have denominators less than or equal to n , arranged in order of increasing size.”

This is fine, but the tests for n=4 and n=5 expects us to return, along with the other reduced fractions, the fraction 2/4, which is not completely reduced. This could be changed to follow the rules presented.

Even the explanation provides the sequences without the fraction 2/4.

How about this:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.