Problem 60486. Compute Farey sequences
Problem statement
The Farey sequence of order n consists of fractions between 0 and 1 expressed in reduced form in increasing order and with no denominator greater than n. For example, the Farey sequence of order 3 is {0/1, 1/3, 1/2, 2/3, 1/1}.
Write a function to compute the Farey sequence of order n. Put the numerators in the first row of a two-row matrix and denominators in the second row.
Further comments
Farey sequences are connected to Stern-Brocot trees, but unlike some other problems of mine (e.g., CP 59791 and 60311), this one was not inspired by a problem of minnolina’s. Instead it arose out of reading The Riemann Hypothesis: The Greatest Unsolved Problem in Mathematics by Karl Sabbagh. Geologist John Farey noted, in a half-page 1816 paper in Philosophical Magazine, a relationship between a fraction in the sequence and the fractions to its left and right. In discussing the connection between the Riemann hypothesis and Farey sequences, Sabbagh writes that, mathematician G.H. Hardy “said, somewhat cruelly:
Just once in his life Mr. Farey rose above mediocrity, and made an original observation. He did not understand very well what he was doing, and he was too weak a mathematician to prove the quite simple theorem he had discovered. It is evident also that he did not consider his discovery…at all important…He had obviously no idea that this casual letter was the one event of real importance in his life. We may be tempted to think that Farey was very lucky; but a man who has made an observation that has escaped Fermat and Euler deserves any luck that comes his way.”
Stunned by this mean-spirited statement—which Hardy read in a 1928 lecture in New York City, I decided to write a problem on the sequences named for Farey.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers8
Suggested Problems
-
3371 Solvers
-
293 Solvers
-
All your base are belong to us
541 Solvers
-
107 Solvers
-
Area of an equilateral triangle
6198 Solvers
More from this Author281
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!