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.

This page as a plain text file.
%I A110786 #11 Jul 10 2024 17:26:31
%S A110786 11,23,31,41,53,61,71,83,97,113,223,331,443,557,661,773,881,991,1013,
%T A110786 1117,1213,1319,14177,1511,1613,171131,1811,1913,2027,2129,2221,
%U A110786 232171,2423,2521,2621,2729,28211,2927,3037,3137,32377,3331,3433,3533
%N 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.
%e A110786 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.
%o A110786 (Python)
%o A110786 from itertools import count
%o A110786 from sympy import isprime
%o A110786 def A110786(n):
%o A110786     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))
%o A110786     for k in count(2):
%o A110786         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)))):
%o A110786             return pq # _Chai Wah Wu_, Jul 10 2024
%Y A110786 Cf. A030675, A110787.
%K A110786 base,easy,nonn
%O A110786 1,1
%A A110786 _Amarnath Murthy_, Aug 12 2005
%E A110786 More terms from _Giovanni Resta_, Feb 08 2006
%E A110786 Edited by _N. J. A. Sloane_, Jan 16 2009