login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A158214 Smallest palindromic prime made up of 0's and k 1's, where k = A007310(n), odd numbers not divisible by 3. 2

%I #11 Dec 18 2015 03:37:25

%S 100111001,110111011,1110111110111,10111101110111101,

%T 100111111111111111001,1111111111111111111,11111111111111111111111,

%U 10111111111101110111111111101,1111110111111111111111110111111

%N Smallest palindromic prime made up of 0's and k 1's, where k = A007310(n), odd numbers not divisible by 3.

%C Smallest palindromic prime with digit sum A007310(n) and using only 0's and 1's.

%H Chai Wah Wu, <a href="/A158214/b158214.txt">Table of n, a(n) for n = 2..167</a>

%o (Python)

%o from __future__ import division

%o from sympy.utilities.iterables import multiset_permutations

%o from sympy import isprime

%o A158214_list = []

%o for i in range(2,101):

%o if i % 6 == 1 or i % 6 == 5:

%o i2 = i//2

%o l = i2

%o flag = True

%o while flag:

%o dlist = '0'*(l-i2) + '1'*i2

%o for d in multiset_permutations(dlist):

%o s = ''.join(d)

%o n = int(s+'1'+s[::-1])

%o if isprime(n):

%o A158214_list.append(n)

%o flag = False

%o break

%o else:

%o l += 1 # _Chai Wah Wu_, Dec 17 2015

%Y Cf. A020449.

%K nonn,base

%O 2,1

%A _Lekraj Beedassy_, Mar 13 2009

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 8 07:09 EDT 2024. Contains 372319 sequences. (Running on oeis4.)