11

Consider the decimal expansion of $\frac{1}{p}$ (where $p$ is an odd prime).

Let $F(p)$ be the period of this decimal expansion.

For instance, $F(3) = 1$ (as $\frac{1}{3} = 0.3333$, which has period $1$)

$F(7) = 6$

$F(11) = 2$

$F(13) = 6$

Now consider the function $G(x)$, defined as the number of different primes for which $F(p)=x$.

For instance, $G(1) = 1$. (There is only one prime $(3)$ which results in a decimal expansion of period $1$.)

$G(2) = 1$. (There also seems to be only one prime $(11)$ which results in an expansion of period $2$.)

How does this function behave? Are there any values of $x$ for which $G(x) = 0$. (That is, is there a length of period that never occurs?)

2 Answers2

3

For $p\ge 7$, you need the order of $10$ modulo $p$, the smallest number $u>0$ with $10^u\equiv 1\mod p$. Because of $10^{p-1}\equiv 1\mod p$, we have $u|p-1$. Then, $u$ is the length of the period in the decimal expansion of $\frac{1}{p}$.

To find the primes $p$ with a given length $L$, just factorize $10^L-1$. Then, for every prime $q$ dividing $L$ remove the prime factors of $10^{L/q}-1$. Then, the remaining primes will produce the desired length.

I am not sure, but there should always be at least one prime remaining. Maybe someone can approve this and show a proof , if it is the case.

Peter
  • 86,576
  • Thanks Peter, great answer. I have a feeling you're correct, but don't know how to prove it. As I understand, this means that G(x) = 1, from x = 1 through to 6. – Thomas Delaney Jan 15 '18 at 04:33
3

Edit, 7/9: This question is not a duplicate and should be reopened; the linked question does not address Thomas' question about whether $G(x) = 0$.


I am not sure, but there should always be at least one prime remaining.

This is true and follows from Zsigmondy's theorem, which asserts that if $a > b$ are coprime positive integers, then for any $n \ge 1$ there exists a prime $p$ which divides $a^n - b^n$ but does not divide $a^k - b^k$ for any $k < n$, except in a small handful of special cases. We can set $a = 10, b = 1$, which does not fall under any of the special cases, which gives:

Corollary: For any $n \ge 1$ there exists a prime $p$ which divides $10^n - 1$ but does not divide $10^k - 1$ for any $k < n$; such a prime then satisfies $F(p) = \text{ord}_p(10) = n$.

So for every $n$ there always exists a prime $p$ such that the period of $\frac{1}{p}$ is exactly $n$. Now we can define a third function $H(n)$ which given a positive integer $n$ returns the smallest prime $p$ such that $F(p) = n$. Note that by Fermat's little theorem we always have $n \mid p-1$. Here are the first few values of this function:

  • $H(1) = 3$, corresponding to $\frac{1}{3} = 0. \overline{3}$ and the factorization $10 - 1 = 3^2$.
  • $H(2) = 11$, corresponding to $\frac{1}{11} = 0.\overline{09}$ and the factorization $\frac{10^2 - 1}{10 - 1} = 11$.
  • $H(3) = 37$, corresponding to $\frac{1}{37} = 0.\overline{027}$ and the factorization $\frac{10^3 - 1}{10 - 1} = 3 \cdot 37$.
  • $H(4) = 101$, corresponding to $\frac{1}{101} = 0.\overline{0099}$ and the factorization $\frac{10^4 - 1}{10^2 - 1} = 101$.
  • $H(5) = 41$, corresponding to $\frac{1}{41} = 0.\overline{02439}$ and the factorization $\frac{10^5 - 1}{10 - 1} = 41 \cdot 271$. This is the first case for which $G(n) \ge 2$; we also have $\frac{1}{271} = 0.\overline{00369}$.
  • $H(6) = 7$, corresponding to $\frac{1}{7} = 0.\overline{142857}$ and the factorization $\frac{10^6 - 1}{10^3 - 1} = 7 \cdot 11 \cdot 13$. We also have $\frac{1}{13} = 0.\overline{076923}$.

This sequence is A007138 on the OEIS. The generalization of the factorizations above is that the primes $p$ such that $F(p) = n$ are always going to be divisors of $\Phi_n(10)$ where $\Phi_n$ are the cyclotomic polynomials (but this is not an if-and-only-if, or at least I don't think it is).


Some more about the function $G(n)$. Say that $p$ is a primitive divisor of $10^n - 1$ if it divides $10^n - 1$ but not $10^k - 1, k < n$ as above, so that $G(n)$ counts the number of primitive (prime) divisors of $10^n - 1$, while $H(n)$ gives the smallest primitive divisor of $10^n - 1$. We can get strictly more information by just computing the entire set of primitive divisors; call this $S(n)$. The $S(n)$ have a nice inductive structure; if we have the values of $S(k), k < n$ we can get the values of $S(n)$ by factoring $10^n - 1$ (or $\Phi_n(10)$, or $\frac{10^n - 1}{10^k - 1}$ for some large divisor $k$ which is what I do below) and then discarding any primes that have already appeared. We have:

  • $S(1) = \{ 3 \}, S(2) = \{ 11 \}, S(3) = \{ 37 \}, S(4) = \{ 101 \}, S(5) = \{ 41, 271 \}, S(6) = \{ 7, 13 \}$ by the above.
  • $\frac{10^7 - 1}{10 - 1} = 239 \times 4649$, which gives $S(7) = \{ 239, 4649 \}$, with decimal expansions $\frac{1}{239} = 0.\overline{0041841}, \frac{1}{4649} = 0.\overline{0002151}$.
  • $\frac{10^8 - 1}{10^4 - 1} = 73 \times 137$, which gives $S(8) = \{ 73, 137 \}$, with decimal expansions $\frac{1}{73} = 0.\overline{01369863}, \frac{1}{137} = 0.\overline{00729927}$.
  • $\frac{10^9 - 1}{10^3 - 1} = 3 \times 333667$, which gives $S(9) = \{ 333667 \}$, with decimal expansion $\frac{1}{333667} = 0.\overline{000002997}$.
  • $\frac{10^{10} - 1}{10^5 - 1} = 11 \times 9091$, which gives $S(10) = \{ 9091 \}$, with decimal expansion $\frac{1}{9091} = 0.\overline{0001099989}$.

$S(n)$ is A046107 on the OEIS and $G(n)$ is A112505 on the OEIS. $G(n)$ grows quite slowly; the OEIS graph shows that $G(n) \le 9$ for $n \le 350$. I think it should be true that $G(n)$ is unbounded but it seems tricky to prove.

Qiaochu Yuan
  • 468,795