|
|
A345307
|
|
Nonpalindromic primes whose binary expansion, interpreted as a base-10 number, yields a palindromic prime.
|
|
0
|
|
|
443, 6827, 7607, 19801, 23581, 31183, 85093, 97213, 314777, 364621, 370477, 382813, 450011, 524287, 1077697, 1159601, 1177073, 1215017, 1299833, 1311749, 1356197, 1458253, 1547069, 1589123, 1613987, 1649299, 1716619, 1851271, 1893607, 2092799, 4404833, 4454369, 4671857
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|