Why do these fractions give $99...9$? Today, as usual, we were doing all those boring numerical computations in our calculators. It all started when my professor replaced $0.2$ with $\frac{1}{5}$. I got into calculating the unit fractions one by one. But soon, I got indulged in unit fractions made from primes, as other numbers can be decomposed into prime factors (and partially because I've always thought that primes are special). Then, I observed a few things.


*

*All unit prime fractions (except $\frac{1}{2}$ & $\frac{1}{5}$) have recurring digits.

*But, there were a few special fractions. For instance, $\frac{1}{7}$ had a digit frequency of $6$ (i.e) $0.\overline{142857}$ - $6$ recurring digits. $\frac{1}{17}$ had a frequency of $16$, $\frac{1}{19}$ had a frequency of $18$, etc.


Only after an hour or so, I was shocked to notice something. "Most" of these primes had a similar property. If $\mathcal{R}(n)$ is the number of recurring digits, then $\mathcal{R}(n)=(n-1)$ for those special primes (Well, it doesn't work for $13$, but the latter result is still true).
Then, came the pattern. First of all, $\mathcal{R}(n)$ is even for these primes, since all primes are odd. While calculating $\frac{1}{13}$, I saw that when we split the recurring digits $0.0\overline{769230}$ in half and add them ($769+230$), we get $999=10^3-1$.
Then, I did the same for $\frac{1}{17}$ and $\frac{1}{19}$, for which I got $(10^8-1)$ and $(10^9-1)$. For every fraction of this kind, the sum is of the form $10^k-1$ where $k\ \in \mathbb N$.
Soon, I found that there was a condition for this form to appear (after writing it out for a few of these primes $7, 13, 17, 19, 23, 29$, etc.). It happens only when
$$\mathcal{R}(n_i)\geq\mathcal{R}(n_{i-1})\ \forall\ \ n \in \mathbb P$$
For instance, this doesn't happen for $1/11$, but it occurred for $1/7$ and $1/13$, since $$\mathcal{R}(11)=2\ <\ \mathcal{R}(7)=8=\mathcal{R}(13)$$
I'm curious about this result. We're slicing those recurring digits in half, right? I can't quite visualize how the summing up those sliced digits converge to the same form. 
Why's this so? Is this true for all these special primes? Or, does this have a limit beyond which this condition breaks down?
 A: A fraction in lowest terms with a prime denominator other than 2 or 5 (i.e. coprime to 10) always produces a repeating decimal. 
The length of the period of the repeating decimal of $1/p$ is equal to the order of $10\mod p$. If 10 is a primitive root modulo $p$, the period of the repeating decimal length is equal to $p − 1$; if not, the period of the repeating decimal length is a factor of $p − 1$. This result can be deduced from Fermat's little theorem, which states that $10^{p−1} = 1 (\mod p)$.
For $13$:
$$10^1\equiv 10\pmod{13}\\10^2\equiv9\pmod{13}\\10^3\equiv12\pmod{13}\\10^4\equiv3\pmod{13}\\10^5\equiv4\pmod{13}\\10^6\equiv1\pmod{13}\\10^7\equiv10\pmod{13}$$
Here we see that the period of $10^k$ modulo $13$ is $6$. The remainders in the period, which are $10,9,12,3,4,1$ do not form a rearrangement of all nonzero remainders modulo $13$, implying that 10 is not a primitive root modulo 13.
$1/13$ contains $6$ repeating digits which indeed is a factor of $12(=13-1)$
If the period of the repeating decimal length of $1/p$ for prime $p$ is equal to $p − 1$ then the period of the repeating decimal, expressed as an integer, is called a cyclic number.Examples include $7,17,19,23,29,97,\cdots$
If $p$ is a prime and $10$ is a primitive root modulo $p$, then the length $\mathcal{R}$ of the period of the repeating decimal of $1/p$ is $\phi(p)$, totient's function.

Let suppose we take $1/p$ which is your "special prime number".Now decimal form of it must be of $$1/p=0.\overline{a_{1}a_{2}\cdots a_{\frac{p-1}2}a_{\frac{p-1}2+1}\cdots a_{p-1}}$$
Now $$10^{\frac{p-1}2}/p+1/p=\left(a_{1}a_{2}\cdots a_{\frac{p-1}2}\right).\left(\overline{a_{\frac{p-1}2+1}\cdots a_{p-1}a_{1}a_{2}\cdots a_{\frac{p-1}2}}\right)+0.\left(\overline{a_{1}a_{2}\cdots a_{\frac{p-1}2}a_{\frac{p-1}2+1}\cdots a_{p-1}}\right)$$ 
We can see that LHS becomes $\frac{10^{\frac{p-1}2}+1}p$ which must be an integer so your result of $999\cdots9$ automatically becomes true, since the decimal part of this number is actually the sum of half parts.
