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.

User: Dan Brumleve

Dan Brumleve's wiki page.

Dan Brumleve has authored 3 sequences.

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

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";
    

A287117 Numbers with no odd prime binary proper prefixes.

Original entry on oeis.org

1, 2, 3, 4, 5, 8, 9, 16, 17, 18, 19, 32, 33, 36, 37, 64, 65, 66, 67, 72, 73, 128, 129, 130, 131, 132, 133, 144, 145, 256, 257, 258, 259, 260, 261, 264, 265, 266, 267, 288, 289, 290, 291, 512, 513, 516, 517, 518, 519, 520, 521, 522, 523, 528, 529, 530, 531, 532, 533, 534, 535
Offset: 1

Author

Dan Brumleve, May 20 2017

Keywords

Examples

			131, while prime itself, has proper binary prefixes 65, 32, 16, 8, 4, 2, 1, none of which are odd primes.
		

Programs

  • Mathematica
    Select[Range@535, AllTrue[ Floor[#/2 ^ Range@Log2@#], ! (# > 2 && PrimeQ[#]) &] &] (* Giovanni Resta, May 20 2017 *)
  • Perl
    sub isp {
      my $x = shift;
      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] // 200) {
      my @np = grep isp($_), rots($i);
      push @z, $i if @np == 0;
    }
    print join(", ", @z) . "\n";

A195324 Even numbers that cannot be represented as the sum of an odd prime and a safe prime (A005385).

Original entry on oeis.org

2, 4, 6, 32, 56, 92, 98, 122, 128, 140, 152, 176, 194, 212, 224, 242, 254, 260, 272, 296, 302, 308, 326, 332, 368, 392, 398, 410, 422, 434, 452, 458, 476, 488, 500, 512, 518, 524, 536, 542, 560, 572, 596, 602, 632, 644, 656, 662, 674, 686, 692, 704, 710, 728
Offset: 1

Author

Dan Brumleve, Sep 15 2011

Keywords

Crossrefs

Cf. A000040 (primes), A005385 (safe primes).

Programs

  • Haskell
    a195324 n = a195324_list !! (n-1)
    a195324_list = filter p [2,4..] where
       p n = all ((== 0) . a010051) $ takeWhile (> 1) $ map (n -) a005385_list
    -- Reinhard Zumkeller, Sep 18 2011
  • Mathematica
    mx = 1000; safe = Select[Prime[Range[PrimePi[mx]]], PrimeQ[(# - 1)/2] &]; p = Prime[Range[2, PrimePi[mx]]]; Complement[Range[2, mx, 2], Union[Flatten[Outer[Plus, p, t]]]] (* T. D. Noe, Sep 15 2011 *)