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.
2, 3, 5, 7, 13, 233, 433, 27361, 121553, 30536929
Offset: 1
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
Comments