Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #23 Jul 20 2017 08:33:01
%S 0,1,1,1,2,1,1,3,2,1,3,1,4,2,1,3,1,5,4,3,2,1,5,1,6,5,4,3,2,1,5,3,1,7,
%T 4,2,1,7,5,3,1,8,7,6,5,4,3,2,1,7,5,1,9,8,7,6,5,4,3,2,1,9,7,3,1,10,8,5,
%U 4,2,1,9,7,5,3,1,11,10,9,8,7,6,5,4,3,2,1,11,7,5,1,12,11,9,8,7,6,4,3,2,1,11,9,7
%N Numerator of Farey fractions sorted according to increasing k, with k = numerator + denominator. Fractions with same k are sorted in order of increasing denominator.
%C The parameter k is the Manhattan distance of the corresponding points to the origin in the "denominator, numerator" representation space.
%C 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, ..., .
%C Note that the fraction 2/4 is not in the above since it can be reduced to 1/2.
%t nmax = 25;
%t (* fracs are fractions represented in the triangle with vertices
%t (0,1),(1,nmax) and (nmax,nmax) *)
%t fracs = Sort@Union@Flatten@Table[a/b, {b, nmax}, {a, 0, b}];
%t (* Sorting generated fractions according to increasing Manhattan distance first, and then by increasing denominator *)
%t fracsorted =
%t SortBy[fracs, {Numerator@# + Denominator@# &, Denominator@# &}];
%t 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 *)
%t Take[Numerator@fracsorted, nmaxlimit]
%Y Cf. A279782, A279783.
%K nonn,frac
%O 1,5
%A _Robert G. Wilson v_ and _Andres Cicuttin_, Dec 25 2016