|
|
A100580
|
|
Palindromic primes containing digits 0 and 1 only. (Palindromic terms in A020449.)
|
|
4
|
|
|
11, 101, 100111001, 110111011, 111010111, 1100011100011, 1100101010011, 1101010101011, 1110110110111, 1110111110111, 100110101011001, 101000010000101, 101011000110101, 101110000011101, 110011101110011
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,1
|
|
LINKS
|
|
|
EXAMPLE
|
a(3) = 100111001 because 100111001 is the third palindromic prime composed only of 1's and 0's.
|
|
MATHEMATICA
|
PalQ[n_]:=FromDigits[Reverse@IntegerDigits[n]]==n; DeleteDuplicates[Flatten[Table[Select[FromDigits /@ Tuples[{0, 1}, n], PrimeQ[#]&&PalQ[#] &], {n, 15}]]] (* Jayanta Basu, May 11 2013 *)
Select[FromDigits/@Tuples[{0, 1}, 15], PalindromeQ[#]&&PrimeQ[#]&] (* Harvey P. Dale, Jan 18 2023 *)
|
|
PROG
|
(Python)
from sympy import isprime
for i in range(2, 2**16):
....s = format(i, 'b')
....x = int(s+s[-2::-1])
....if isprime(x):
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
Chuck Seggelin (seqfan(AT)plastereddragon.com), Nov 29 2004
|
|
STATUS
|
approved
|
|
|
|