# Period of decimal for $1/n$, odd part of $n+1$, and primes.

Let $n$ be a nature number is coprime to $10$,such that the period of the decimal expansion of $1/n$ is a divisor of $n-1$, and let $c$ be the "cycle length of $n$" (defined below). If $n-1=2^xc$ or $n+1=2^xc$ for some $x\in\Bbb{N}^{>0}$, then $n$ is prime.

For example, using $n=41$:

The period of $1/41=0.0243902439\dots$ is $5$ and $5$ is a divisor of $41-1$, the "cycle length of $41$" is $10$, $(41-1)/10 = 4 = 2^2$, so $41$ is prime.

Is there any counterexample to this?

To define the "cycle length of $n$" (using $n=73$ as an example):

Step 1 : 73 +  1 =  74. Get the odd part of  74, which is 37
Step 2 : 73 + 37 = 110. Get the odd part of 110, which is 55
Step 3 : 73 + 55 = 128. Get the odd part of 128, which is  1


Continuing this operation (with $73 + 1$) repeats the same steps as above. There are $3$ steps in the cycle, so the cycle length of $73$ is $c=3$.

• What is "the period of $1/n$"? Also, you wrote $41-1=4$. – Mario Carneiro May 26 '13 at 7:16
• 1/41 = 0.0243902439... the period of the decimal expansion of 1/n – miket May 26 '13 at 7:21
• I think this is always a divisor of $n-1$. – Mario Carneiro May 26 '13 at 7:22
• That's (41-1)/10 = 4 – miket May 26 '13 at 7:23
• Also posted, with no link here, to MO: mathoverflow.net/questions/131900/… – Gerry Myerson May 27 '13 at 1:35