Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #69 Nov 04 2022 19:53:30
%S 3,5,23,47,89,101,149,157,163,173,179,199,229,313,331,367,379,383,443,
%T 457,523,587,631,643,647,653,659,709,883,947,997,1009,1091,1097,1163,
%U 1259,1277,1283,1289,1321,1483,1601,1669,1693,1709,1753,1877,2063,2069,2099
%N Primes whose binary representation is also the decimal representation of a prime.
%C In general rebase notation (Marc LeBrun): p2 = (2) [p] (10).
%C Also: Primes in A036952. - _M. F. Hasler_, Dec 11 2012
%C See A089971 for the binary representation of these terms. - _M. F. Hasler_, Jan 05 2014
%H Harry J. Smith and K. D. Bajpai, <a href="/A065720/b065720.txt">Table of n, a(n) for n = 1..10000</a> (first 1000 terms from Harry J. Smith)
%H M. F. Hasler, <a href="https://docs.google.com/document/d/10IM7fcAbB2tqRGuwfGvuEGUzD_IXbgXPDK0tfxN4M3o/pub">Primes whose base c expansion is also the base b expansion of a prime</a>
%H Carlos Rivera, <a href="http://www.primepuzzles.net/puzzles/puzz_280.htm">Puzzle 280. 3893257</a>, The Prime Puzzles & Problems Connection.
%F Equals A036952 intersect A000040. - _M. F. Hasler_, Dec 11 2012
%e 1009{10} = 1111110001{2} is prime, and 1111110001{10} is also prime.
%e 89 is in the sequence because it is a prime. Binary representation of 89 = 1011001, which is also a prime.
%p select(t -> isprime(t) and isprime(convert(t,binary)),[seq(2*i+1,i=1..1000)]); # _Robert Israel_, Jul 08 2014
%t Select[ Range[1900], PrimeQ[ # ] && PrimeQ[ FromDigits[ IntegerDigits[ #, 2]]] & ]
%t Select[ Prime@ Range@ 330, PrimeQ[ FromDigits[ IntegerDigits[#, 2]]] &] (* _Robert G. Wilson v_, Oct 09 2014 *)
%o (PARI) {(baseE(x, b)= local(d, e=0, f=1); while (x>0, d=x-b*(x\b); x\=b; e+=d*f; f*=10); e); n=0; for (m=1, 10^9, p=prime(m); b=baseE(p, 2); if (isprime(b), write("b065720.txt", n++, " ", p); if (n==1000, return)) ) } \\ _Harry J. Smith_, Oct 27 2009
%o (PARI) isok(p) = isprime(p) && isprime(fromdigits(binary(p), 10)); \\ _Michel Marcus_, Mar 04 2022
%o (Python)
%o from sympy import isprime
%o def ok(n): return isprime(n) and isprime(int(bin(n)[2:]))
%o print([k for k in range(2100) if ok(k)]) # _Michael S. Branicky_, Mar 04 2022
%Y Cf. A065721, A065722, A065723, A065724, A065725, A065726, A065727, A065361.
%Y Cf. A123266, A256621, A256622.
%K nonn,base
%O 1,1
%A _Patrick De Geest_, Nov 15 2001
%E a(48)-a(50) from _K. D. Bajpai_, Jul 04 2014