Solution:
We write all fractions of the form b/a, where a and b are relatively prime, and 0≤b≤a≤n, in ascending order. For instance, for n=5, this is the sequence
10,51,41,31,52,21,53,32,43,54,11
This sequence is known as the Farey sequence.
Now, if we look at the the sequence of the denominators of the fractions, we see that k appears φ(k) times when k>1, although 1 appears twice. Thus, there are N+1 elements in the Farey sequence. Let the Farey sequence be
a1b1,a2b2,…,aN+1bN+1
Now, aN+1=1, so the sequence a1,a2,…,aN contains φ(k) instances of k for every 1≤k≤n. We claim that this sequence also satisfies
a1a21+a2a31+⋯+aNa11=1.
Since a1=aN+1=1, we have
a1a21+a2a31+⋯+aNa11=a1a21+a2a31+⋯+aNaN+11.
Now, it will suffice to show that aiai+11=ai+1bi+1−aibi. Once we have shown this, the above sum will telescope to aN+1bN+1−a1b1=1−0=1.
To see why aiai+11=ai+1bi+1−aibi holds, we note that this is equivalent to 1=bi+1ai−biai+1. We can prove this fact geometrically: consider the triangle in the plane with vertices (0,0),(ai,bi), and
(ai+1,bi+1). This triangle contains these three boundary points, but it contains no other boundary or interior points since ai and ai+1 are relatively prime to bi and bi+1, respectively, and since no other fraction with denominator at most n lies between aibi and ai+1bi+1. Thus, by Pick's theorem, this triangle has area 1/2. But the area of the triangle can also be computed as the cross product 21(bi+1ai−biai+1); hence bi+1ai−biai+1=1 and we are done.