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.

A110787 Least palindrome which when appended to the n-th palindrome gives a prime.

This page as a plain text file.
%I A110787 #10 Jul 10 2024 18:14:32
%S A110787 1,3,1,1,3,1,1,3,7,3,3,1,3,7,1,3,1,1,3,7,3,9,77,1,3,131,1,3,7,9,1,171,
%T A110787 3,1,1,9,11,7,7,7,77,1,3,3,1,3,3,1,9,11,1,9,1,7,3,101,111,3,1,3,11,1,
%U A110787 77,7,1,131,1,3,7,3,3,1,9,3,1,1,3,1,9,7,33,111,7,3,3,11,3,77,1,99,7,7,11,1,1
%N A110787 Least palindrome which when appended to the n-th palindrome gives a prime.
%C A110787 A002113(n) concatenated with a(n) is a prime. A110786(n) is that prime. - _Franklin T. Adams-Watters_, Oct 11 2006
%o A110787 (Python)
%o A110787 from itertools import count
%o A110787 from sympy import isprime
%o A110787 def A110787(n):
%o A110787     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 A110787     for k in count(2):
%o A110787         if isprime(int(s+str(q:=(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 A110787             return int(q) # _Chai Wah Wu_, Jul 10 2024
%Y A110787 Cf. A110786.
%K A110787 base,easy,nonn
%O A110787 1,2
%A A110787 _Amarnath Murthy_, Aug 12 2005
%E A110787 More terms from _Franklin T. Adams-Watters_, Oct 11 2006