login
A065720
Primes whose binary representation is also the decimal representation of a prime.
87
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,1
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
LINKS
Harry J. Smith and K. D. Bajpai, Table of n, a(n) for n = 1..10000 (first 1000 terms from Harry J. Smith)
Carlos Rivera, Puzzle 280. 3893257, The Prime Puzzles & Problems Connection.
FORMULA
Equals A036952 intersect A000040. - M. F. Hasler, Dec 11 2012
EXAMPLE
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.
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 *)
PROG
(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
KEYWORD
nonn,base
AUTHOR
Patrick De Geest, Nov 15 2001
EXTENSIONS
a(48)-a(50) from K. D. Bajpai, Jul 04 2014
STATUS
approved