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.

A065720 Primes whose binary representation is also the decimal representation of a prime.

Original entry on oeis.org

3, 5, 23, 47, 89, 101, 149, 157, 163, 173, 179, 199, 229, 313, 331, 367, 379, 383, 443, 457, 523, 587, 631, 643, 647, 653, 659, 709, 883, 947, 997, 1009, 1091, 1097, 1163, 1259, 1277, 1283, 1289, 1321, 1483, 1601, 1669, 1693, 1709, 1753, 1877, 2063, 2069, 2099
Offset: 1

Views

Author

Patrick De Geest, Nov 15 2001

Keywords

Comments

In general rebase notation (Marc LeBrun): p2 = (2) [p] (10).
Also: Primes in A036952. - M. F. Hasler, Dec 11 2012
See A089971 for the binary representation of these terms. - M. F. Hasler, Jan 05 2014

Examples

			1009{10} = 1111110001{2} is prime, and 1111110001{10} is also prime.
89 is in the sequence because it is a prime. Binary representation of 89 = 1011001, which is also a prime.
		

Crossrefs

Programs

  • Maple
    select(t -> isprime(t) and isprime(convert(t,binary)),[seq(2*i+1,i=1..1000)]); # Robert Israel, Jul 08 2014
  • Mathematica
    Select[ Range[1900], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 2]]] & ]
    Select[ Prime@ Range@ 330, PrimeQ[ FromDigits[ IntegerDigits[#, 2]]] &] (* Robert G. Wilson v, Oct 09 2014 *)
  • PARI
    isok(p) = isprime(p) && isprime(fromdigits(binary(p), 10)); \\ Michel Marcus, Mar 04 2022
    
  • Python
    from sympy import isprime
    def ok(n): return isprime(n) and isprime(int(bin(n)[2:]))
    print([k for k in range(2100) if ok(k)]) # Michael S. Branicky, Mar 04 2022

Formula

Equals A036952 intersect A000040. - M. F. Hasler, Dec 11 2012

Extensions

a(48)-a(50) from K. D. Bajpai, Jul 04 2014