Sorry, I shoud have provided more verbal explanation.
1st step: Invert the fraction and set 'a' to be the largest integer less than or equal to the result.
2nd step. Subtract 'a' from the inverted fraction. If this isn't zero
3rd step: Repeat the first two steps with the fraction left over from step 2, to get the next constant until step 2 results in zero.