OFFSET
1,1
COMMENTS
Numbers k such that A175349(k) = prime(k).
EXAMPLE
a(3) = 98 is a term because the 98th composite is 130 which is 10000010 in binary, the 98th prime is 521 which is 1000001001 in binary, and the first 8 bits of 1000001001 are 10000010.
MAPLE
g:= proc(p, c)
StringTools:-Search(convert(convert(c, binary), string),
convert(convert(p, binary), string)) <> 0
end proc:
nextcomp:= proc(c)
if isprime(c+1) then c+2 else c+1 fi
end proc:
p:= 1: c:= 2: Res:= NULL: count:= 0:
for n from 1 to 10^7 do
p:= nextprime(p);
c:= nextcomp(c);
if g(p, c) then Res:= Res, n; count:= count+1; fi
od:
R;
MATHEMATICA
p = 1;
c = 2;
Table[
p = NextPrime[p];
c += If[PrimeQ[c + 1], 2, 1];
mod = 2^BitLength[c];
test = NestWhile[BitShiftRight, p,
BitAnd[#, mod - 1] != c && # > c &];
If[test >= c, n, Nothing]
, {n, 10^5}]
(* David Trimas, Dec 01 2024 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert Israel, Nov 28 2024
STATUS
approved