login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A287638
Odd primes with no other odd primes as prefixes in binary.
1
3, 5, 17, 19, 37, 67, 73, 131, 257, 521, 523, 577, 1033, 1039, 1061, 1063, 1069, 1153, 1163, 2053, 2069, 2081, 2083, 2089, 2113, 2129, 2131, 2137, 2141, 2143, 2333, 4099, 4111, 4129, 4153, 4177, 4229, 4231, 4241, 4243, 4261, 4271, 4273, 4637, 4639, 4643, 4649, 4651, 4657, 4663
OFFSET
1,1
COMMENTS
The sum of the reciprocals converges by the Kraft-McMillan inequality.
Odd primes p such that iterating the map A029578 on p reaches 2 without going through a prime. - Ya-Ping Lu, Oct 20 2021
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
Dan Brumleve, Does the sum of reciprocals of all prime-prefix-free numbers converge?, Math StackExchange, May 20 2017.
EXAMPLE
4663 is an odd prime with proper binary prefixes 2331, 1165, 582, 291, 145, 72, 36, 18, 9, 4, 2, 1, and none of these are odd primes.
MATHEMATICA
Select[Prime@ Range[2, 800], Function[w, NoneTrue[Array[FromDigits[w[[1 ;; #]], 2] &, Length[w] - 1], And[PrimeQ[#], # != 2] &]]@ IntegerDigits[#, 2] &] (* Michael De Vlieger, Oct 20 2021 *)
PROG
(Perl)
sub isp {
my $x = shift;
return 0 if $x < 2;
for my $d (2 .. $x - 1) {
return 0 if $x % $d == 0;
}
return 1;
}
sub rots {
my $x = shift;
my @x;
while ($x > 5) {
$x = int($x / 2);
push @x, $x;
}
@x
}
for my $i (1 .. $ARGV[0] // 8000) {
my @np = grep isp($_), rots($i);
push @z, $i if isp($i) && $i % 2 && @np == 0;
}
print join(", ", @z) . "\n";
(PARI) is(n)=if(!isprime(n) || n<3, return(0)); while(n>3, if(isprime(n>>=1), return(n==2))); 1 \\ Charles R Greathouse IV, Jun 12 2017
CROSSREFS
Odd prime elements of A287117.
Cf. A029578.
Sequence in context: A045415 A045416 A038891 * A119768 A020592 A295387
KEYWORD
nonn,easy,base
AUTHOR
Dan Brumleve, May 28 2017
STATUS
approved