yield_nonreduced_fractions

mathtools.yield_nonreduced_fractions()

Yields positive nonreduced fractions in Cantor diagonalized order.

>>> generator = mathtools.yield_nonreduced_fractions()
>>> for n in range(16):
...     next(generator)
...
(1, 1)
(2, 1)
(1, 2)
(1, 3)
(2, 2)
(3, 1)
(4, 1)
(3, 2)
(2, 3)
(1, 4)
(1, 5)
(2, 4)
(3, 3)
(4, 2)
(5, 1)
(6, 1)

Returns generator.