For a positive integer N, collect every fraction a/b with 0≤a≤b≤N and gcd(a,b)=1, then list them from smallest to largest. That list is the Farey sequence of order N.
For example, the Farey sequence of order 6 is
0/1, 1/6, 1/5, 1/4, 1/3, 2/5, 1/2, 3/5, 2/3, 3/4, 4/5, 5/6, 1/1
Write a program that computes the length of the Farey sequence of order N, that is, how many fractions it holds.