2

E.g. 1/8=0.125 has three decimals when written out in base 10, but what is a good example of a simple fraction where the decimal sequence terminates but is very large?

Is there some sort of rule which determines how many decimals the terminating exact decimal expansion can have based on the amount of digits in the numerator and denominator?

1 Answers1

8

Given a fraction $p/q$, first get it into its lowest terms (so that $p$ and $q$ have no common factor). Then, if $q$ is of the form $2^a5^b$ for integers $a,b$, its decimal expansion has max$(a,b)$ digits after the decimal point. If it's not of this form, its decimal expansion is non-terminating (but repeating).

TonyK
  • 64,559
  • What's the length of the repeating part in the second case? – Mitch Feb 10 '11 at 15:02
  • 1
    @Mitch: For the case when q is prime, I refer you to Wikipedia: http://en.wikipedia.org/wiki/Repeating_decimal#Every_rational_number_is_either_a_terminating_or_repeating_decimal – TonyK Feb 10 '11 at 16:12
  • @Mitch: the length of the repeating part is the smallest positive integer $k$ for which $q$ is a factor of $10^k-1$ (this follows from the algebraic method for rewriting a repeating decimal as a fraction). Though the two answers are a bit terse and dense (one of them is mine), you might want to have a look at this question. – Isaac Feb 10 '11 at 16:55
  • Exactly what I was looking for, thanks. – Rune Aamodt Feb 10 '11 at 16:55