Saturday 21 March 2015

The longest repeating decimal that can be created from a simple fraction



What's the longest possible repeating decimal (repetend) that can be created from a fraction if:





  • The numerator has to be less than or equal to 9,999

  • The denominator has be less than or equal to 9,999?



I know the repeating decimal part can't exceed the denominator - 1. So the longest possible repeating decimal part has to be 9,998 or less.



The reason I want to know is to test an algorithm that I wrote which accepts fractions with numerators and denominators up to 9,999. The largest repeating decimal part I was able to create so far was 1/97 which equaled 0.[01030927 83505154 63917525 77319587 62886597 93814432 98969072 16494845 36082474 22680412 37113402 06185567] (96 repeating digits).


Answer




The numerator doesn't matter (for this question), so you might as well let it be $1$. The denominator should be the largest prime under $10000$ which has $10$ as a primitive root. I don't know offhand what that prime is, but I'm sure such primes are tabulated and shouldn't be hard to locate.



The table at the Online Encyclopedia doesn't go far enough. There is an applet which claims to find these primes, but I couldn't make it work --- maybe you'll have better luck.


No comments:

Post a Comment

real analysis - How to find $lim_{hrightarrow 0}frac{sin(ha)}{h}$

How to find $\lim_{h\rightarrow 0}\frac{\sin(ha)}{h}$ without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...