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

Let $n$ be a nature number is relatively prime to 10,such the period of the decimal expansion of $1/n$ is $n-1$ or 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$ must be 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$ must be 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$.

-
It looks like the sequence of cycle lengths is given at oeis.org/A179382 –  Barry Cipra May 26 '13 at 13:25
Just to be clear, the claim is an "if" and not an "if and only if" -- the cycle length of $47$ is $9$, which doesn't divide either $46$ or $48$, much less leave a power of $2$ as a quotient. –  Barry Cipra May 26 '13 at 13:41
@Barry Cipra, cycle length of 47 is 9,you are right,that's A179382.Counterexample is a number meet the case,but not a prime. –  Mike May 26 '13 at 13:56
Maybe this related to probability.So at least needs to test to 15 digits to see if there's a counterexample. –  Mike May 26 '13 at 14:02
@Mike, how many composite numbers have you tested the assertion against? Also, if you drop all the conditions on $n$ prior to the "let $c$...." I see $n=15$ as a counterexample, but are there others? In particular, why are you concerned with the period of the decimal expansion of $1/n$? –  Barry Cipra May 26 '13 at 14:58