login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A158215 Smallest palindromic prime made up of 0's and p(n) 1's, where p(n) is the n-th prime = A000040(n) (or 0 when no such prime exists). 1
11, 0, 100111001, 110111011, 1110111110111, 10111101110111101, 100111111111111111001, 1111111111111111111, 11111111111111111111111, 1111110111111111111111110111111, 11111101111111110101111111110111111 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

Smallest palindromic prime with digit sum A000040(n) and using only 0's and 1's. Subsequence of A158214.

Smallest palindromic prime with digit sum A000040(n) and using only 0's and 1's. Subsequence of A100580.(Sequence link edited). [Lekraj Beedassy, Jun 21 2009]

LINKS

Chai Wah Wu, Table of n, a(n) for n = 1..168

PROG

(Python)

from __future__ import division

from itertools import combinations

from sympy import prime, isprime

def A158215(n):

    if n == 1:

        return 11

    if n == 2:

        return 0

    p2 = prime(n)//2

    l = p2

    while True:

        for i in combinations(range(l), l-p2):

            s = ['1']*l

            for x in i:

                s[x] = '0'

            s = ''.join(s)

            q = int(s+'1'+s[::-1])

            if isprime(q):

                return q

        l += 1 # Chai Wah Wu, Nov 05 2015

CROSSREFS

Cf. A157712

Cf. A158214. [Lekraj Beedassy, Jun 21 2009]

Sequence in context: A165399 A157712 A266379 * A294254 A216792 A260237

Adjacent sequences:  A158212 A158213 A158214 * A158216 A158217 A158218

KEYWORD

nonn,base

AUTHOR

Lekraj Beedassy, Mar 13 2009

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 22 13:15 EDT 2021. Contains 348170 sequences. (Running on oeis4.)