cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A110786 To obtain a(n), take the n-th palindrome P = A002113(n) and concatenate it with the smallest palindrome Q such that PQ is a prime.

Original entry on oeis.org

11, 23, 31, 41, 53, 61, 71, 83, 97, 113, 223, 331, 443, 557, 661, 773, 881, 991, 1013, 1117, 1213, 1319, 14177, 1511, 1613, 171131, 1811, 1913, 2027, 2129, 2221, 232171, 2423, 2521, 2621, 2729, 28211, 2927, 3037, 3137, 32377, 3331, 3433, 3533
Offset: 1

Views

Author

Amarnath Murthy, Aug 12 2005

Keywords

Examples

			The palindrome 171 gives a prime 171131 when concatenated with 131 and no palindrome less than 131 gives a prime on concatenation: 1711,1713,1717,1719,17111, etc. up to 171121 are all composite.
		

Crossrefs

Programs

  • Python
    from itertools import count
    from sympy import isprime
    def A110786(n):
        s = str((c:=n+1-x)*x+int(str(c)[-2::-1] or 0) if n+1<(x:=10**(len(str(n+1>>1))-1))+(y:=10*x) else (c:=n+1-y)*y+int(str(c)[::-1] or 0))
        for k in count(2):
            if isprime(pq:=int(s+str((c:=k-x)*x+int(str(c)[-2::-1] or 0) if k<(x:=10**(len(str(k>>1))-1))+(y:=10*x) else (c:=k-y)*y+int(str(c)[::-1] or 0)))):
                return pq # Chai Wah Wu, Jul 10 2024

Extensions

More terms from Giovanni Resta, Feb 08 2006
Edited by N. J. A. Sloane, Jan 16 2009