Ever wondered what kind of rational numbers (so called "fractions", like 3/4) have a finite decimal representation? At first let's take a look the usual base ten numeral system with the following examples.
I'm not sure if I chose the examples carefully enough so that it would be easy to see what's common with all the finite fractions. Anyway let's make another kind of representation for the finite ones:
Well, the common thing is that in the finite cases the denominator is a product of only numbers 2 or 5. Where does these two numbers come from? It's well known fact, that every positive integer (>1) is either a prime number (can be divided only with 1 or itself) or a product of prime numbers (Euclid proved this). The number system we were studing was the base ten and the prime factors of 10 are 2 and 5.
So the answer to the original question is: all the fractions where the denominator can be presented as a product of 2's and 5's, have a finite decimal representation. More mathematically we could say that the denominator should be:
In other the numeral systems than the base ten, the answer is quite similar. The allowed numbers in the denominator always depens on the prime factors of the numeral systems base number. In base eight it could only contain 2 (8=2*2*2), in base twelve 2 and 3 (12=2*2*3), in base nine just 3 (9=3*3) and so on.