Farey sequence: Difference between revisions

A bit more clear D output
(+ D entry)
(A bit more clear D output)
Line 53:
writefln("Farey sequence for order 1 through 11:\n%(%s\n%)",
iota(1, 12).map!farey);
writeln("Number\nNumber of fractions in the Farey sequence "
"for order 100 through 1_000 by hundreds:\n",
iota(100, 1_001, 100).map!fareyLen);
Line 70:
[0, 1/10, 1/9, 1/8, 1/7, 1/6, 1/5, 2/9, 1/4, 2/7, 3/10, 1/3, 3/8, 2/5, 3/7, 4/9, 1/2, 5/9, 4/7, 3/5, 5/8, 2/3, 7/10, 5/7, 3/4, 7/9, 4/5, 5/6, 6/7, 7/8, 8/9, 9/10, 1]
[0, 1/11, 1/10, 1/9, 1/8, 1/7, 1/6, 2/11, 1/5, 2/9, 1/4, 3/11, 2/7, 3/10, 1/3, 4/11, 3/8, 2/5, 3/7, 4/9, 5/11, 1/2, 6/11, 5/9, 4/7, 3/5, 5/8, 7/11, 2/3, 7/10, 5/7, 8/11, 3/4, 7/9, 4/5, 9/11, 5/6, 6/7, 7/8, 8/9, 9/10, 10/11, 1]
 
Number of fractions in the Farey sequence for order 100 through 1_000 by hundreds:
[3045, 12233, 27399, 48679, 76117, 109501, 149019, 194751, 246327, 304193]</pre>