# Length of the non-periodic portion of the decimal expansion of $\frac 1n$

The following question was asked in the Indian National Mathematics Olympiad (INMO) 2015.

For any natural number $n>1$,write the infinite decimal expansion of $\frac 1n$. Determine the length of the non-periodic part of the (infinite) decimal expansion of $\frac 1n$.

By an infinite decimal expansion, the question means a decimal expansion not ending in an infinite string of zeros. For example ,we write $\frac 12 = 0.4999...$ as its infinite decimal expansion, not $0.5$.

• So what is your question? What did you do so far? (And why is $0.50000\ldots$ not an infinite expansion?) Commented Feb 2, 2015 at 9:56
• @flawr Well, I think $0.5000...=0.4999...$, but when it comes to infinite expansion, people seem to prefer the first form.
– Vim
Commented Feb 2, 2015 at 10:04
• @flawr Sir I have no idea about this question.This question was asked in the Indian National Mathematics Olympiad (INMO) 2015 and is correctly stated. Commented Feb 2, 2015 at 10:09
• @SNEHILSINHA Please put a little more thought into your question titles and tags. Read tag wikis and use elementary-number-theory instead of number-theory. Use contest-math for contest math problems. Make your title specifically describe exactly the problem you have. Commented Feb 2, 2015 at 13:37
• @Goos Thank you sir I will take care of that.:) Commented Feb 3, 2015 at 8:40

For $n|10^k$ for some $k>0$ you'll have a finite representation with $k$ digits, $$\frac1n = 0.N_1\ldots N_k\bar0$$ For $n\!\!\not|\,10^k$ for ally $k>0$ it seems to be a bit more difficult, but also dependent on $\max_{k\in\mathbb N}\gcd(n, 10^k)$.
For a start I'd expect from you to show some work. I suggest you start with $\frac1p$ for $p$ prime an not a divisor of $10$.
I conjecture that it is in fact $$l(n) = \min\{k| k = \max_{k\in\mathbb N}\gcd(n, 10^k)\}$$ Wich is equivalent to $$l(n) = \max(\mathrm{Pow}_2(n), \mathrm{Pow}_5(n))$$ Where $\mathrm{Pow}_p(n)$ is the prime-power function giving the power of a prime in the factorisation of $n$.
• Multiply the numerator and denominator by the appropiate power to have something of the forms $$\frac{2^x}{10^yz},\frac{5^x}{10^yz}$$ Where $(z,10)=1$. It is now easier to see that $$\frac{2^x}{z},\frac{5^x}{z}$$ do not have a nonperiodic part, and that $y$ has the conjectured form. Commented Mar 15, 2015 at 22:03