When does the fraction $142/2.54$ ever repeat?

53 Views Asked by At

I recently measured my kid's height, and I found that it was $142$ cm. I wanted to convert this to feet and inches, so I divided $142$ by $2.54$, yielding an approximate answer of 55.905511811. I decided to look further, so I inspected the first $100$ places, hoping for a repeat. There were none. I was surprised by this, as most fractions tend to repeat after around $20$ places. I pursued on, to later find that after $20,000$ places, there were NO REPEATS. I was stupefied, and I couldn't go any further, as my computer was struggling to keep up with the demand. I decided to rest for a bit and wondered how long will the decimal go on before I encounter a repeat? Obviously, it's not going to be an irrational number as $142/2.54$ is $7100/127$, which is a rational number. So, can anybody tell me when will the fraction $142/2.54$ repeat?

Also, running this code here (It won't work anymore, sorry) will produce the first 1000 places of $142/2.54$

By the way, this is my first question, so although this might seem impractical, can you help me out?

1

There are 1 best solutions below

2
On BEST ANSWER

Note that $\frac{142}{2.54}=100\times\frac{71}{127}$. Since $127$ is prime, it may well happen that the decimal expansion of $\frac{71}{127}$ is periodic with period $126$. But that's not the case. It turns out that it is periodic with period $42\left(=\frac{126}3\right)$. In fact,$$\frac{71}{127}=0.\overbrace{559\,055\,118\,110\,236\,220\,472\,440\,944\,881\,889\,763\,779\,527}^{42\text{ digits}}\ldots$$and then it repeats itself over and over.