Alright, thanks, you made realize the exeptions. To develop on that, It would be better to proove that if a and b have no common factor, the result of a/b, let say c is non-terminating, to the exeption of a = 2, 5 and b = 2, 5
a/b = c
If c is terminating, with d number of digits, it would mean
10^d-1 a/b is an integrer
which means that 10^d-1 has b as one of its factors. Since a power has the same factors than its roots, and 10 = 5*2, this is not possible. Thus a/b cannot be an integrer.
Taking the case of the set {1, 11, 111...}
Each one of this number is equal to 1 + 10^1 + 10^2...10^n and thus equal to
\frac{10^n-1}{9}
Thus, if devided by a, the result is
\frac{10^n-1}{9a}
Since a is prime, in order for this to be terminated is that \frac{10^n-1}{9} has a as one of its factor. So The numbers that do exeptions to the rule are the numbers that satisfy this condition.