I wanted to know if there exists a formula or a script that generates the period length for the reciprocal of prime numbers. So for example $\frac17 = 0.142857142857142857$ so a period length of $6$.
I know there is a 10^k mod p but this takes too long for large numbers.
I have seen in this question: Compute the period of a decimal number a priori
@Ross Millikan mentioned that "The period is always a factor of the quotient of the denominator" but I don't know of any literature behind this.
If you know anything about literature on this idea or a formula that can quickly calculate the period length for very large primes, I would be grateful if you can let me know
Update: What I want to know more about is Ross's observation and why couldn't that be used to calculate the repeat digit period for very large numbers? So that's why I asked for literature on this.
Thank you.