A065720 Primes whose binary representation is also the decimal representation of a prime.
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
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.
Links
- Harry J. Smith and K. D. Bajpai, Table of n, a(n) for n = 1..10000 (first 1000 terms from Harry J. Smith)
- M. F. Hasler, Primes whose base c expansion is also the base b expansion of a prime
- Carlos Rivera, Puzzle 280. 3893257, The Prime Puzzles & Problems Connection.
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
Extensions
a(48)-a(50) from K. D. Bajpai, Jul 04 2014
Comments