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-4 of 4 results.

A091932 Primes that remain prime when their leading digit in binary representation is replaced by 0.

Original entry on oeis.org

7, 11, 13, 19, 23, 29, 37, 43, 61, 67, 71, 83, 101, 107, 131, 139, 151, 157, 181, 199, 211, 229, 241, 263, 269, 293, 317, 353, 359, 383, 419, 449, 467, 479, 523, 541, 571, 601, 613, 619, 643, 661, 691, 709, 739, 751, 769, 823, 829, 859, 991, 1021, 1031, 1061
Offset: 1

Views

Author

Reinhard Zumkeller, Feb 14 2004

Keywords

Comments

A053645(a(n)) is prime.
Primes p such that p - 2^floor(log_2(p)) is prime - T. D. Noe, Apr 08 2011

Examples

			A000040(12)=37 --> '100101' --> '[1]00101' --> '[0]00101' --> '101' --> 5, therefore 37 is a term.
		

Crossrefs

Cf. A091931.
Cf. A118958.

Programs

  • Mathematica
    Select[Prime[Range[100]], PrimeQ[# - 2^Floor[Log[2, #]]] &] (* T. D. Noe, Apr 08 2011 *)
    Select[Prime[Range[200]],PrimeQ[FromDigits[Rest[ IntegerDigits[ #,2]],2]]&] (* Harvey P. Dale, Apr 08 2016 *)
  • Python
    from sympy import isprime, primerange
    def ok(p): return isprime((1 << (p.bit_length()-1)) ^ p)
    def aupto(lim): return [p for p in primerange(1, lim+1) if ok(p)]
    print(aupto(1061)) # Michael S. Branicky, Jul 11 2021

Formula

A118953(A049084(a(n))) = 1; subsequence of A065380. - Reinhard Zumkeller, May 07 2006

A078687 Number of x>=0 such that prime(n)-2^x is prime.

Original entry on oeis.org

0, 1, 1, 2, 2, 2, 1, 3, 2, 1, 2, 2, 1, 2, 2, 1, 1, 3, 2, 2, 2, 2, 3, 1, 1, 2, 2, 2, 2, 2, 0, 3, 1, 4, 0, 2, 2, 1, 3, 2, 1, 4, 1, 1, 2, 4, 2, 1, 3, 3, 1, 1, 3, 0, 2, 2, 1, 3, 2, 1, 2, 3, 1, 1, 2, 2, 0, 0, 2, 2, 3, 1, 2, 0, 2, 3, 1, 2, 2, 2, 1, 3, 1, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 1, 2, 3, 0, 1, 3, 2, 1, 1, 3, 1, 4
Offset: 1

Views

Author

Benoit Cloitre, Dec 17 2002

Keywords

Examples

			prime(17)=59 and only 59-2^3 = 53 is prime hence a(17)=1
		

Crossrefs

Cf. A156695.

Programs

  • Mathematica
    f[p_] := Block[{c = exp = 0, lmt = 1 + Floor@ Log2@ p}, While[exp < lmt, If[ PrimeQ[p - 2^exp], c++]; exp++]; c]; Array[ f@ Prime@# &, 105] (* Robert G. Wilson v, Jul 07 2014 *)
  • PARI
    a(n)=sum(i=0,floor(log(prime(n))/log(2)),if(isprime(prime(n)-2^i),1,0))

Formula

a(A049084(A065381(n)))=0, a(A049084(A065380(n)))=1; A118953(n)<=a(n); a(n)=A109925(A000040(n)). - Reinhard Zumkeller, May 07 2006

A118958 Primes that cannot be written as 2^k + p with p prime < 2^k.

Original entry on oeis.org

2, 3, 5, 17, 31, 41, 47, 53, 59, 73, 79, 89, 97, 103, 109, 113, 127, 137, 149, 163, 167, 173, 179, 191, 193, 197, 223, 227, 233, 239, 251, 257, 271, 277, 281, 283, 307, 311, 313, 331, 337, 347, 349, 367, 373, 379, 389, 397, 401, 409, 421, 431, 433, 439, 443
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2006

Keywords

Comments

A118953(A049084(a(n))) = 0; A065381 is a subsequence.

Crossrefs

Programs

  • Maple
    filter:= proc(n) not isprime(n-2^ilog2(n)) end proc:
    select(filter, [seq(ithprime(i),i=1..100)]); # Robert Israel, Jan 27 2021
  • Mathematica
    okQ[n_] := !PrimeQ[n-2^(Length[IntegerDigits[n, 2]]-1)];
    Select[Prime[Range[100]], okQ] (* Jean-François Alcover, Feb 04 2023 *)

A118952 Characteristic function of numbers that can be written as p+2^k, where p is prime and p less than 2^k (A118957).

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1
Offset: 1

Views

Author

Reinhard Zumkeller, May 07 2006

Keywords

Comments

0 <= a(n) <= 1, a(n) <= A109925(n);
a(A118956(n)) = 0, a(A118957(n)) = 1;
A118953(n) = a(A000040(n)).
Showing 1-4 of 4 results.