Are all positive odd integer matchs this three conditions will be a prime number?

95 Views Asked by At
  1. The period length of the decimal expansion of $1/n = 2^x$ and $n-1$ divides by the length.
  2. The sum of $n = 2^x$.
  3. The cycle length of $n = 2^x$.

($x$ is some positive integer)

(using $n=23$ as an example to define the sum of $n$ and the cycle length of $n$):

Step 1 : Get the odd part of $23 + ~~1 $, which is $~~3$,$~~3\times2^3=23 + ~~ 1$,get $s_1 = 3$
Step 2 : Get the odd part of $23 + ~~3 $, which is $13$,$13\times2^1=23 + ~~ 3$,get $s_2 = 1$
Step 3 : Get the odd part of $23 + 13 $, which is $~~9$,$~~9\times2^2=23 + 13$,get $s_3 = 2$
Step 4 : Get the odd part of $23 + ~~9 $, which is $~~1$,$~~1\times2^5=23 + ~~9$,get $s_4 = 5$

Continuing this operation (with $23 + 1$) repeats the same steps as above. There are $4$ steps in the cycle, so the cycle length of $23$ is $4$,and the sum of $23$ is $s_1 + s_2 + s_3 + s_4 = 11$. The period length of the decimal expansion of $1/23$ is $22$.

I checked numbers that matchs this three conditions up to $10^7$, get this three number, $17, 257, 65537$, it seems they are prime numbers, so my question is: are all positive odd integer matchs this three conditions will be a prime number?

EDIT:

After add 'and $n−1$ divides by the length' to condition 1, I search positive odd integer from $1$ to $65537$, get this: $17, 257, 641, 65537$, it seems they are all prime numbers.(and prime $167772161$ also is xth item of the seq)

P.S. Python code to get the the sum of $n$ and the cycle length of $n$ for $n =17$:

def ck(n):    
    def f(n, t):
        k = 0 
        while (t << k) < n: k += 1
        return (t << k) - n, k
    o, s, c = 1, 0, 0
    while True:     
        o, z  = f(n, o)
        c += z       
        s = s + 1
        if o == 1 or o == 0: break
    return s, c

ck(17)
# out put (4, 8)