On the binary expansion of the reciprocals of prime numbers I have been thinking a little bit about the binary decimal expansion of reciprocal prime numbers; and I have a few questions.
I found this neat table (Wayback Machine) which lists the binary expansion of many fractions, and I was trying to find some patterns.
Here are my questions, for brevity I say a natural number has a period N if the binary decimal expansion of it's reciprocal has period N: (for example, 1/7 = .001001... has period 3)

*

*Given an arbitrary natural number N, does there exist a prime number of minimum period N?

(By minimum period I mean to exclude the case that one prime has a period which is a multiple of the period of another prime.  For example, 1/3 = .0101... has period 2, and 1/5 = .00110011... has period 4; so while 1/3 has period 4, what I call it's "minimum period" is 2)
2.
Can two prime numbers have the same minimum period?
A useful result which I believe is well known, is that a natural number has a period N if and only if it is a factor of 2N - 1.
Does anyone know of a good reference that describes some theory behind the relationship between the period of the reciprocal of a natural number, and the prime factorization of that number?
 A: (In the below post there are several links with the apostrophes omitted; fill them in if the links don't work.)
The phenomenon you are studying is a phenomenon in modular arithmetic.  If a prime $p$ has period $n$, this means that there is some numerator $N$ such that $\frac{N}{2^n - 1} = \frac{1}{p}$.  This is equivalent to $Np = 2^n - 1$, or $p | 2^n - 1$, or $2^n \equiv 1 \bmod p$.  The smallest $n$ for which this is true is called the order of $2 \bmod p$, sometimes denoted $\text{ord}_p(2)$ (although this is confusingly also used to denote the greatest power of $p$ which divides $2$...).
Fermat's little theorem guarantees that $\text{ord}_p(2)$ always divides $p-1$; you have already observed this yourself.  However, predicting the exact order is very difficult to do in general.  For example, knowing that the order is actually equal to $p-1$ is equivalent to knowing that $2$ is a primitive root, and it is not currently even known whether this is true infinitely often.  In any case, you should be able to find basic information about order in any good textbook on elementary number theory.
With that background out of the way...
The answer to question 1 is no.  The only exception is $n = 6$ by Zsigmondy's theorem.
The answer to question 2 is yes.  If $p$ and $n$ are relatively prime, then $p$ has period $n$ if and only if $p$ divides $\Phi_n(2)$, where $\Phi_n(x)$ is the $n^{th}$ cyclotomic polynomial.  (This is more or less a restatement of the condition that $p | 2^n - 1$ but $p$ doesn't divide $2^k - 1$ for $k < n$.)  So it suffices to show that some number of this form has more than one prime factor relatively prime to $n$.  There are two cases here which are particularly classical:

*

*$n$ is a prime $q$.  In this case $\Phi_q(2) = 2^q - 1$ is a Mersenne number, and $2^{11} - 1 = 23 \cdot 89$ is the smallest composite Mersenne number, hence $23$ and $89$ both have period $11$.


*$n = 2^k$ for some $k$.  In this case $\Phi_{2^k}(2) = 2^{2^{k-1}} + 1$ is a Fermat number, and $\Phi_{64}(2) = 2^{32} + 1 = 641 \cdot 6700417$ is the smallest composite Fermat number, hence $641$ and $6700417$ both have period $64$.
The answer to question 3 is the following.
Lemma: If $n, m$ are relatively prime odd numbers, then $\text{ord}_{mn}(2) = \text{lcm}(\text{ord}_n(2), \text{ord}_m(2))$.
Proof. $\text{ord}_{mn}(2)$ is the order of the element $2$ in the multiplicative group of $\mathbb{Z}/mn\mathbb{Z}$, which we will denote $U(mn)$.  By the Chinese remainder theorem, $U(mn)$ is isomorphic to the direct product $U(m) \times U(n)$, so the order of $2$ in $U(mn)$ must be the $\text{lcm}$ of the orders of $2$ in $U(m)$ and $U(n)$.
It follows that to compute $\text{ord}_m(2)$ for arbitrary $m$ it suffices to compute it for the odd prime power factors of $m$ and then to take the $\text{lcm}$ of the resulting numbers.  (Note that if $m$ is divisible by a power of $2$ this only contributes a leading string of zeroes to the binary expansion of $\frac{1}{m}$ and hence does not affect the computation of the period.)  Again, you can find a discussion of the Chinese remainder theorem in any good textbook on elementary number theory.  (I am particularly bad at recommending textbooks on elementary number theory because I learned mine through a summer program, not a textbook...)
