Questions about cyclic numbers, repeating decimals, and full reptend primes

170 Views Asked by At

I have a few questions about cyclic numbers in base $b$ ($b = 2$ in particular). We are dealing here with primes $p$ such that the length of the period in the decimal (more precisely base $b$) representation of $1/p$ is equal to $p-1$. For instance, in base $10$, primes $p=7, 17, 19, 23, 29, 47, 59, \cdots$ have this property. In base $2$, $p = 3, 5, 11, 13, 19, 29,\cdots$ have this property.

My questions are:

  • Does the period of $1/p$, for large $p$'s satisfying this property (having a period of length $p-1$), look random?
  • Can you compute the first $100,000$ primes in base $2$ satisfying this property?

Final purpose

The final purpose of this exercise is to check whether a number such as $e^{-1}$ has its digits uniformly distributed, by approximating $e^{-1}$ with a sequence $\{x_n\}$ built as follows: $x_n = b^n/q_n$ where $q_n$ is the prime in question that minimizes the approximation error. Here $b$ is the base. The idea is that such a converging sequence (or sub-sequence) exists for a number such as $e^{-1}$ ($x_n \rightarrow e^{-1})$ but maybe not for a rational number. As $e^{-1}$ is approximated by rational numbers of increasing period $n-1$, and as long as the period look random, at the limit, we would conclude that the digits of $e^{-1}$ are uniformly distributed.

1

There are 1 best solutions below

0
On

I know this is an old question. I've been exploring characteristics of these lately. Specifically in base 10 mostly. I'm going to state some things I stumbled on without explanation first.

For reptend primes p, there is a period of p-1 digits. The (p-1)/2 digit will be p-1. This means that if (10**((p-1)/2)) % p == p-1, it's a candidate for being a reptend prime. I'm pretty sure you can change the base and do this same process to find candidates for long periods primes in other cases.

To confirm your prime is a reptend prime(or other base long period prime), you also have to test for multiplicative order mod p. If it passes, it's a long period prime.

Reptend primes (p-1)%10 have an equal quantity of each digit in their decimal expansions. I can explain further if anyone is interested.