Is there an algorithm for figuring out the following things?
Check out decimal expansion, and specifically about the period of a fraction.