OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
a(3) = 71 is a term because 71 is prime, its base-10 reversal 17 is a prime other than 71, and its base-2 reversal 113 is a prime other than 71.
MAPLE
filter:= proc(n) local L, nL, i, r, s;
if not isprime(n) then return false fi;
L:= convert(n, base, 10);
nL:= nops(L);
r:= add(10^(nL-i)*L[i], i=1..nL);
if r=n or not isprime(r) then return false fi;
L:= convert(n, base, 2);
nL:= nops(L);
s:=add(2^(nL-i)*L[i], i=1..nL);
s <> n and isprime(s)
end proc:
select(filter, [seq(i, i=3..10000, 2)]);
MATHEMATICA
Select[Range[4000], (ir = IntegerReverse[#]) != # && PrimeQ[#] && PrimeQ[ir] && (ir2 = IntegerReverse[#, 2]) != # && PrimeQ[ir2] &] (* Amiram Eldar, Aug 23 2021 *)
Select[Prime[Range[600]], !PalindromeQ[#]&&FromDigits[Reverse[IntegerDigits[#, 2]], 2]!=#&&AllTrue[{IntegerReverse[#], FromDigits[Reverse[IntegerDigits[#, 2]], 2]}, PrimeQ]&] (* Harvey P. Dale, Oct 13 2022 *)
PROG
(Python)
from sympy import isprime, primerange
def ok(p):
s, b = str(p), bin(p)[2:]
if s == s[::-1] or b == b[::-1]: return False
return isprime(int(s[::-1])) and isprime(int(b[::-1], 2))
print(list(filter(ok, primerange(1, 3720)))) # Michael S. Branicky, Aug 24 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
J. M. Bergot and Robert Israel, Aug 23 2021
STATUS
approved