Repeating Decimal in Different Bases

67 67500 \large \dfrac{67}{67500}

The decimal expansion of 67 67500 \frac{67}{67500} is 0.0009 925 0.0009\overline{925} , where 925 is the repeating block, as indicated by the overline. That is, 0.0009 925 = 0.0009925925925 , 0.0009\overline{925} = 0.0009 925 925 925\ldots, where the block 925 repeats infinitely.

Find the number of positive integers n 67500 n\leq67500 such that the base- n n expansion of 67 67500 \dfrac{67}{67500} terminates after a finite number of digits.


The answer is 2250.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

2 solutions

Calvin Lin Staff
Dec 14, 2016

Lemma: The rational number p q \frac{p}{q} (with gcd ( p , q ) = 1 \gcd(p,q) = 1 ) in base n n terminates if and only if q n k q \mid n^k for some k k .

Proof: If p q \frac{ p}{q} terminates in k k digits after the decimal point, then n k × p q n^k \times \frac{p}{q} is an integer, implying that q n k q \mid n^k .
Conversely, if p q \frac{ p}{q} does not terminate in k k digits after the decimal point for any k k , then this tells us that n k × p q n^k \times \frac{p}{q} is never an integer, and thus q ∤ n k q \not \mid n^k for any k k . _ \square


Applying the above lemma to the problem, we get that 67500 n k 67500 \mid n^k for some large enough k k . Since the set of factors of 67500 is { 2 , 3 , 5 } \{2, 3, 5 \} , this tells us that 30 n 30 \mid n is a necessary and sufficient condition. Thus, there are 67500 30 = 2250 \lfloor \frac{67500 } { 30 } \rfloor = 2250 solutions.

Your lemma killed the problem.Nice lemma!

Harsh Shrivastava - 4 years, 5 months ago

Log in to reply

Sometimes it's having the "right" interpretation / phrasing, that provides clarity to the problem. I believe that everyone is (subconsciously) aware of the lemma especially in base 10, and it's just how we can explain it to ourselves / others.

Calvin Lin Staff - 4 years, 5 months ago

Wouldn't it be 2500 since the only way it can be be repeating infinitly is if in the denominator, there is a factor of 3, and 67500 equals 27 times 2500 so the only numerators that can make the decimal expansion terminate is if it is divisible by 27, so numbers 0, 27, 54.......67500 will work and dividing 27 we get the sequence 0, 1, 2....2500 so the total numbers that can work are 2501 integers but as 0 is not positive, the answer is 2500.

Razzi Masroor - 4 years, 5 months ago

Log in to reply

Read the lemma again.

In particular, it is not sufficient that

since the only way it can be be repeating infinitly is if in the denominator, there is a factor of 3.

Calvin Lin Staff - 4 years, 5 months ago

Let's prove the theorem that

Theorem : For p , q N , q 1 p, q \in \mathbb N, q\neq1 and g c d ( p , q ) = 1 gcd(p,q)=1 ,

Base- b b expansion of p q \dfrac{p}{q} terminates after a finite number of digits D q D b \iff D_q \subseteq D_b , where for any positive integer c c , D c D_c is the set of all distinct prime factors of c c .

For the sake of clarification, when c = 40 = 2 3 × 5 c=40=2^3 \times 5 , D 40 = { 2 , 5 } D_{40} = \{ 2,5\} .

To prove the theorem, we'll use a number of lemmas.


  • Lemma - 1 1 : For any positive integer q q and b b , with q 1 q \neq 1 and b 2 b\geq2 , q b m q \mid b^m for some m D q D b m \iff D_q \subseteq D_b .

Proof : If q b m q \mid b^m for some m m , every prime factor of q b q \in b . So, D q D b D_q \subseteq D_b .

Now assume, D q D b D_q \subseteq D_b . Let m m be the minimum positive integer such that for each prime w D q w \in D_q , the highest exponent e e of w w , with w e q w^e \mid q , doesn't exceed m m . Then q b m q \mid b^m .

That proves Lemma - 1 1 .


  • Lemma - 2 2 : For any positive integer p , b p, b and m m , with b 2 b \geq 2 , base- b b expansion of ( p × b m ) = p b m (p\times b^{-m})= \dfrac{p}{b^m} terminates after a finite number of digits.

Proof : Let the base- b b expansion of p p be b n b n 1 b 1 b 0 = b n × b n + b n 1 × b n 1 + + b 1 × b 1 + b 0 × b 0 \overline{b_nb_{n-1}\cdots{ } \cdots{ } \cdots{ }b_1b_0}=b_n\times b^n+b_{n-1}\times b^{n-1}+ \cdots{ } \cdots{ } \cdots{ }+b_1\times b^1+b_0 \times b^0 , where n 0 n\geq0 is a positive integer and for each integer i i (with 0 i n 0\leq i \leq n ), 0 b i < b 0\leq b_i<b .

Then, ( p × b m ) = p b m = b n × b n m + b n 1 × b n 1 m + + b 1 × b 1 m + b 0 × b m (p\times b^{-m})= \dfrac{p}{b^m}= b_n\times b^{n-m}+b_{n-1}\times b^{n-1-m}+ \cdots{ } \cdots{ } \cdots{ }+b_1\times b^{1-m}+b_0 \times b^{-m} . As every power of b b in the latter expression is unique in the expression, and for each integer i i (with 0 i n 0\leq i \leq n ), 0 b i < b 0\leq b_i<b , and for some j j (with 0 j n 0\leq j\leq n ) and every k k (with 0 k < j 0\leq k <j ), b j 0 b_j\neq0 and b k = 0 b_k=0 , base- b b expansion of ( p × b m ) = p b m (p\times b^{-m})= \dfrac{p}{b^m} terminates after a finite number of digits; with ( m j ) (m-j) digits after the unit digit (exclusive).

This establishes Lemma - 2 2 .


  • Lemma -3: For any positive integer r 0 r\neq0 (with g c d ( q , r ) = 1 = g c d ( p , q ) gcd(q,r)=1=gcd(p,q) and q 1 q\neq1 ), base- b b expansion of p q \dfrac{p}{q} terminates after a finite number of digits \iff base- b b expansion of p r q = p q × r \dfrac{pr}{q}=\dfrac{p}{q} \times r terminates after a finite number of digits.

Proof : Assume that base- b b expansion of p q \dfrac{p}{q} terminates after a finite number of digits. Then there is m m digits after the unit digit (exclusive), for some positive integer m m . Then, ( p q × b m ) (\dfrac{p}{q}\times b^m) is an integer. But p q = ( p q × b m ) × b m \dfrac{p}{q} = (\dfrac{p}{q}\times b^m) \times b^{-m} , which implies p r q = ( p q × r × b m ) × b m \dfrac{pr}{q} = (\dfrac{p}{q}\times r \times b^m) \times b^{-m} . But as ( p q × r × b m ) (\dfrac{p}{q}\times r \times b^m) is an integer, the base- b b expansion of the right hand side of the last equation, by Lemma - 2 2 , terminates after a finite number of digits. So does p r q \dfrac{pr}{q} .

Now suppose that base- b b expansion of p r q = p q × r \dfrac{pr}{q}=\dfrac{p}{q} \times r terminates after a finite number of digits. That means, for some positive integer m m , ( p r q × b m ) = ( p q × b m ) × r (\dfrac{pr}{q}\times b^m)=(\dfrac{p}{q} \times b^m)\times r is an integer, which implies ( p q × b m ) (\dfrac{p}{q} \times b^m) is an integer, as q q and r r are coprime and q 1 q\neq1 . And as ( p q × b m ) (\dfrac{p}{q} \times b^m) is an integer, base- b b expansion of p q \dfrac{p}{q} terminates after a finite number of digits.

This completes the proof for Lemma - 3 3 .


Now we prove the theorem stated at the beginning. Let's restate the theorem for convenience.

Statement : For p , q N , q 1 p, q \in \mathbb N, q\neq1 and g c d ( p , q ) = 1 gcd(p,q)=1 ,

Base- b b expansion of p q \dfrac{p}{q} terminates after a finite number of digits D q D b \iff D_q \subseteq D_b , where for any positive integer c c , D c D_c is the set of all distinct prime factors of c c .

Proof : Assume that base- b b expansion of p q \dfrac{p}{q} terminates after a finite number of digits. Then for some positive integer m m , ( p q × b m ) (\dfrac{p}{q}\times b^m) is an integer. As g c d ( p , q ) = 1 gcd(p,q)=1 and q 1 q \neq 1 , q b m q\mid b^m , which, by Lemma - 1 1 , implies, D q D b D_q \subseteq D_b .

Suppose, D q D b D_q \subseteq D_b . Then, by Lemma - 1 1 , q b m q \mid b^m for some positive integer m m . Then p q = ( p q × b m ) × b m \dfrac{p}{q}=(\dfrac{p}{q}\times b^m)\times b^{-m} . The right side of the last equation, by Lemma - 2 2 , terminates after a finite number of digits, as p q × b m \dfrac{p}{q}\times b^m is an integer. So does p q \dfrac{p}{q} , which is the left side of the same equation.

This completes the proof.


Now, D 67500 = 2 2 × 3 3 × 5 4 = { 2 , 3 , 5 } D_{67500=2^2\times3^3\times5^4}=\{2,3,5\} . That means, each n n must be divisible by 2 × 3 × 5 = 30 2\times3\times5=30 . There are 67500 30 = 2250 \lfloor\dfrac{67500}{30}\rfloor=2250 such n 67500 n\leq67500 , as the minimum of such n n is strictly larger than 2 2 .

So, the answer is 2250 \boxed{2250} .


NOTE :

  • Although we state and prove the theorem only for positive fractions/rational numbers p q \dfrac{p}{q} , it's not hard to see it's valid also for negative fractions.

  • Lemma - 3 3 isn't used in the proof of the theorem. After writing the proof for Lemma - 3 3 , I found this proof of the theorem, which doesn't use Lemma - 3 3 .

The argument can be greatly shortened in the following way:

Theorem: The rational number p q \frac{p}{q} in base n n terminates if and only if q n k q \mid n^k for some k k .
Proof: If p q \frac{ p}{q} terminates in k k digits after the decimal point, then n k × p q n^k \times \frac{p}{q} is an integer, implying that q min n k q \min n^k .
Conversely, if p q \frac{ p}{q} does not terminate in k k digits after the decimal point for any k k , then this tells us that n k × p q n^k \times \frac{p}{q} is never an integer, and thus q ∤ n k q \not \mid n^k for any k k . _ \square

Note: The conditions q 1 q \neq 1 and gcd ( p , q ) = 1 \gcd(p,q) = 1 are not needed.

Calvin Lin Staff - 4 years, 6 months ago

Log in to reply

Wow! You can post it as another solution, please!

Muhammad Rasel Parvej - 4 years, 6 months ago

Or should I replace my solution with your one?

Muhammad Rasel Parvej - 4 years, 6 months ago

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...