How and why can it be true that some decimals that sometimes go on forever in base 10 such as $1\over 3$ change to good numbers in base 12? I've noticed on a math channel on YouTube that some of these decimals from fractions in the decimal system such as $1\over 3$, which equals $0.\overline3$, which goes on forever, doesn't show off this thing in the dozenal, or duodecimal, system: $4\over 12$ is the same as $1\over 3$ and it converts to $4\over 10$, or $4$ over do, which gets us $0.4$ if we look at it that way.  Also, $1\over 4$ kindly equals $0.25$, which obviously terminates.  Also, $3\over 12$ is the same as $1\over 4$, which converts to $3\over 10$ or $3$ over do, which gets us $0.3$ if we look at it that way.  This can also happen for fractions $1\over 2$, $1\over 6$, and even $1\over 12$.  This can also happen with base-$10$ fractions with some denominators divisible by $12$.  How and why is this true?

Fractions terminate if all the prime factors of the denominator (once the fraction is in lowest terms) are prime factors of the base.  In base $10$, fractions terminate if the denominator has no prime factors besides $2$ and $5$, so fractions with denominators like $2,5,16,125,200,$ etc will terminate.  In base $12$, fractions terminate if the denominator has no prime factors other than $2$ and $3$.  $\frac 19=0.14_{12}$ terminates nicely, but $\frac 15=0.\overline{2497}_{12}$ does not.  If you go to base $30$ then you can afford factors $2,3$ and $5$ and have your fractions terminate.  Unfortunately, your addition and multiplication tables get much larger.
