Two functions are used: divisibility and remainder.
Writes the divisible result to a string and adds the remainder X 10 to the result.
Until there is no remainder, or the length of the result string reaches n.