cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A348352 Primes p where p-1 is in A328596 (reversed binary expansion is an aperiodic necklace) and the same count of numbers smaller than p-1 are found in A328596 as primes smaller than p exist.

Original entry on oeis.org

2, 3, 5, 7, 13, 233, 433, 27361, 121553, 30536929
Offset: 1

Views

Author

Thomas Scheuerle, Oct 14 2021

Keywords

Comments

If this sequence is infinite, then the density of aperiodic necklaces (Lyndon words) in the reversed binary expansion of numbers and the density of prime numbers, may have some interesting connection. If there exists a deeper relation, an analogy of Goldbach's conjecture based on numbers in A328596 could be investigated, would that provide any new knowledge regarding prime numbers?

Crossrefs

Programs

  • MATLAB
    function a = A348352(max_range)
        a = [];
        bits = floor(log2(max_range))+2;
        p = primes(max_range);
        lw = lyndonwords(1);
        lyndonw = lw{2};
        for n = 2:bits
            lyndonw =[lyndonw lyndonwords(n)];
        end
        for n = 1:length(p)
            prime = p(n);
            wraw = bitget(prime-1,1:bits);
            word = wraw(1:find(wraw == 1, 1, 'last' ));
            if length(lyndonw{n}) == length(word)
                if lyndonw{n} == word
                    a = [a prime];
                end
            end
        end
    end
    function words = lyndonwords(maxlen)
        words = cell(1);
        wordindex = 1;
        w = 0;
        while ~isempty(w)
           len = length(w);
           if(len == maxlen)
                s = [];
                for j = 1:length(w)
                    s = [s w(j)];
                end
                words{wordindex} = s;
                wordindex = wordindex + 1;
            else
                while length(w) < maxlen
                     w = [w w(1+length(w)-len)];
                end
           end
            while ~isempty(w) && w(end) == 1
                w = w(1:end-1);
            end
            if ~isempty(w)
                w(end) = 1;
            end
        end
    end

Formula

A348268(a(n) - 1) = a(n).
A348268(a(n)*2^m - 1) = a(n)*2^m.
If A000040(m) = a(n) then A328596(m) = a(n) - 1;