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$.

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$.
EDIT
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$.
