OFFSET
1,1
EXAMPLE
443 is a nonpalindromic prime. Its binary expansion is 110111011, which, when interpreted as a base-10 number, is a palindromic prime.
MATHEMATICA
Select[Range[5000000], PrimeQ[#] && ! PalindromeQ[#] && PrimeQ[FromDigits[IntegerDigits[#, 2]]] && PalindromeQ[FromDigits[IntegerDigits[#, 2]]] &]
ppQ[p_]:=With[{c=FromDigits[IntegerDigits[p, 2], 10]}, PrimeQ[c]&&PalindromeQ[c]]; Select[Prime[ Range[ 330000]], !PalindromeQ[#]&&ppQ[#]&] (* Harvey P. Dale, Feb 11 2024 *)
PROG
(Python)
from sympy import isprime, primerange
def ispal(s): return s == s[::-1]
def aupto(limit):
alst = []
for p in primerange(13, limit+1):
if not ispal(str(p)):
b = bin(p)[2:]
if ispal(b) and isprime(int(b)): alst.append(p)
return alst
print(aupto(5*10**6)) # Michael S. Branicky, Jun 13 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Tanya Khovanova, Jun 13 2021
STATUS
approved