Challenge
In this task you would be given an integer N (less than 10^5), output the Farey sequence of order N.
The input N is given in a single line,the inputs are terminated by EOF.
Input
4
3
1
2
Output
F4 = {0/1, 1/4, 1/3, 1/2, 2/3, 3/4, 1/1}
F3 = {0/1, 1/3, 1/2, 2/3, 1/1}
F1 = {0/1, 1/1}
F2 = {0/1, 1/2, 1/1}
Constraints
- The number of inputs would not exceed 10^6 values
- You can use any language of your choice
- Shortest solution wins!