[seqfan] Need more items for sequence 17, 257, 641, 65537, …

Tw Mike mt.kongtong at gmail.com
Thu Oct 17 09:31:41 CEST 2019


Dear seqfans,

Let n be an odd positive integer, let o=ordn2 be the order of 2 modulo n
and m the period of 1/n, k is number of distinct odd residues contained in
set {2^1,2^2,...,2^{n−1}} modulo n.

If odd part of o,m and k is 1 and k divide n-1, then n is item in the
sequence 17, 257, 641, 65537, ….

167772161 also is item.It seems all known items are primes.

Here's my PARI/GP code to check numbers(there's large space left for
improve):

    oddres(n)=if(n<2,0,n>>valuation(n,2))
    ck(n) = {
    my(l=List(),m=if(1<n/=5^valuation(n, 5)<<valuation(n, 2),
znorder(Mod(10, n)), 0),o=znorder(Mod(2,n)));
    forstep(i=0,-o,-1,if((2^i % n) % 2 == 1, listput(l, 2^i % n)));
    [m,#(Set(l)),o]
    }
    forstep(n=1, 1e3, 2, [m,k,o] = ck(n); if( oddres(m) == 1 &&  (n - 1) %
m == 0 && oddres(k) == 1 && oddres(o) == 1, print1(n", "m", "k", "o",\n")))
    \\out put:
    17, 16, 4, 8,
    257, 256, 8, 16,
    641, 32, 32, 64,

 ways to calculate k(A179382 number of distinct odd residues contained in
set {2^1,2^2,...,2^{n−1}} modulo n):


k1(n)=my(l=List());for(i=1,n-1,if((2^i%n)%2==1,listput(l,2^i%n)));#(Set(l))

k2(n)=my(l=List());forstep(i=0,-znorder(Mod(2,n)),-1,if((2^i%n)%2==1,listput(l,2^i%n)));#(Set(l))

k3(n)=my(o=1,s=0,c=0,f(n,t)=my(k=0);while((t<<k)<n,k++);(t<<k)-n);while(1,o=f(n,o);c+=z;s+=1;if(o<2,break););s
    forstep(n=1, 1e2, 2, print1(k3(n)", "))

Are there more efficient way to calculate k?

Best Regards
Mike,



More information about the SeqFan mailing list