OFFSET
2,1
COMMENTS
Smallest palindromic prime with digit sum A007310(n) and using only 0's and 1's.
LINKS
Chai Wah Wu, Table of n, a(n) for n = 2..167
PROG
(Python)
from __future__ import division
from sympy.utilities.iterables import multiset_permutations
from sympy import isprime
A158214_list = []
for i in range(2, 101):
if i % 6 == 1 or i % 6 == 5:
i2 = i//2
l = i2
flag = True
while flag:
dlist = '0'*(l-i2) + '1'*i2
for d in multiset_permutations(dlist):
s = ''.join(d)
n = int(s+'1'+s[::-1])
if isprime(n):
A158214_list.append(n)
flag = False
break
else:
l += 1 # Chai Wah Wu, Dec 17 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Lekraj Beedassy, Mar 13 2009
STATUS
approved