OFFSET
1,5
COMMENTS
The parameter k is the Manhattan distance of the corresponding points to the origin in the "denominator, numerator" representation space.
The fractions in order begin: 0/1, 1/1, 1/2, 1/3, 2/3, 1/4, 1/5, 3/4, 2/5, 1/6, 3/5, 1/7, 4/5, 2/7, 1/8, ..., .
Note that the fraction 2/4 is not in the above since it can be reduced to 1/2.
MATHEMATICA
nmax = 25;
(* fracs are fractions represented in the triangle with vertices
(0, 1), (1, nmax) and (nmax, nmax) *)
fracs = Sort@Union@Flatten@Table[a/b, {b, nmax}, {a, 0, b}];
(* Sorting generated fractions according to increasing Manhattan distance first, and then by increasing denominator *)
fracsorted =
SortBy[fracs, {Numerator@# + Denominator@# &, Denominator@# &}];
nmaxlimit = Floor[(1/6)* nmax^2]; (* Safe limit for a correctly sorted sequence since asymptotically half of the generated fractions can be properly sorted according to Manhattan distance *)
Take[Numerator@fracsorted, nmaxlimit]
CROSSREFS
KEYWORD
nonn,frac
AUTHOR
Robert G. Wilson v and Andres Cicuttin, Dec 25 2016
STATUS
approved