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.

Showing 1-1 of 1 results.

A287638 Odd primes with no other odd primes as prefixes in binary.

Original entry on oeis.org

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

Views

Author

Dan Brumleve, May 28 2017

Keywords

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

Examples

			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.
		

Crossrefs

Odd prime elements of A287117.
Cf. A029578.

Programs

  • 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 *)
  • 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
  • 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";
    
Showing 1-1 of 1 results.