After seeing the solution that my book advocated, I implemented it using recursion.
Write a random number generator for [0,7) using only a random number generator for [0,5). Ensure the results are uniformly distributed.