To be more precise, $A(p)=\min\{x:p\mid10^x-1\}$ This seems to be different from $φ(p)$ but is always a factor of $φ(p)$. For example, $A(37)=3=φ(37)/12$. I would like to get a clear way of calculating $A(p)$ or a formula for it in terms of $φ(p)$ and other functions.
Smallest number in the sequence $9,99,999,9999\cdots$ that is divisible by $p \in \mathbb{P}$.
-
2Do you mean "is divisible by $p$"? – 2017-01-07
-
3There isn't a simple closed formula for the order of $10\pmod p$. You just have to check the divisors of $p-1$. Note: I am assuming $p$ is prime, but you don't state that. For general $n$ you'd need to check the divisors of $\varphi(n)$. – 2017-01-07
-
0@lulu That's what I meant. – 2017-01-07
-
0what is $p$? ${}{}{}{}$ – 2017-01-07
-
0@JorgeFernándezHidalgo A prime number – 2017-01-07
-
0Ah, you've discovered the order of an element of a group divides the order of the group itself. – 2017-01-07
1 Answers
What you want to know is order of $10$ in $(\Bbb Z/p\Bbb Z)^\times$, group of invertible elements in $\Bbb Z/p\Bbb Z$. Unfortunately, to the best of my knowledge, there is no known formula for this.
However, you correctly noticed that order of $10$ will always be a divisor of $\varphi(p)$. This is direct consequence of Lagrange's theorem, order of an element of a group will always divide the order of the group. Since the order of $(\Bbb Z/p\Bbb Z)^\times$ is $\varphi(p)$, order of $10$ will divide $\varphi(p)$.
To demonstrate that this is not trivial, I will do it the other way around, for given positive integer $n$, I will find all prime $p$ such that order of $10$ in $(\Bbb Z/p\Bbb Z)^\times$ is $n$:
$$\begin{array}{c | c} n & p\\\hline 1 & 3\\ 2 & 11\\ 3 & 37\\ 4 & 101\\ 5 & 41, 271\\ 6 & 7, 13\\ 7 & 239, 4649\\ 8 & 73, 137\\ 9 & 333667\\ 10 & 9091 \end{array}$$
You can do it yourself by factoring $10^n-1$.