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.

A111383 Beginning with 3, least member of A007500 such that concatenation of first n terms and its digit reversal both are primes.

This page as a plain text file.
%I A111383 #12 Jan 03 2025 11:47:48
%S A111383 3,7,3,3,79,701,157,1103,11959,1901,10273,92753,17047,11909,144973,
%T A111383 327251,99289,92831,90373,309671,1149619,745397,1232083,94793,18481,
%U A111383 76607,186649,181421,1657561,3746111,7067239,324143,3185263,9457181,1703413,3517583,72481,12859481
%N A111383 Beginning with 3, least member of A007500 such that concatenation of first n terms and its digit reversal both are primes.
%H A111383 Michael S. Branicky, <a href="/A111383/b111383.txt">Table of n, a(n) for n = 1..164</a>
%o A111383 (Python)
%o A111383 from gmpy2 import digits, is_prime, mpz
%o A111383 from itertools import count, islice, product
%o A111383 def bgen(): # generator of terms of A007500 -{2, 5} as strings
%o A111383     yield from "37"
%o A111383     p = 11
%o A111383     for digits in count(2):
%o A111383         for first in "1379":
%o A111383             for mid in product("0123456789", repeat=digits-2):
%o A111383                 for last in "1379":
%o A111383                     s = first + "".join(mid) + last
%o A111383                     if is_prime(mpz(s)) and is_prime(mpz(s[::-1])):
%o A111383                         yield s
%o A111383 def agen(): # generator of terms
%o A111383     s, r, an, san = "", "", 3, "3"
%o A111383     while True:
%o A111383         yield int(an)
%o A111383         s, r = s+san, san[::-1]+r
%o A111383         for san in bgen():
%o A111383             if is_prime(mpz(s+san)) and is_prime(mpz(san[::-1]+r)):
%o A111383                 break
%o A111383         an = mpz(san)
%o A111383 print(list(islice(agen(), 34))) # _Michael S. Branicky_, Jan 02 2025
%Y A111383 Cf. A113584, A111382, A007500.
%K A111383 nonn,base
%O A111383 1,1
%A A111383 _Hans Havermann_, Nov 08 2005
%E A111383 a(35) and beyond from _Michael S. Branicky_, Jan 02 2025