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.
%I A068160 #18 Oct 02 2024 12:18:36 %S A068160 2,101,11311,1114111,111181111,111110611111,1111118111111, %T A068160 111111151111111,111111110911111111,11111111128111111111, %U A068160 111111111161111111111,111111111110911111111111,11111111111104111111111111,1111111111111031111111111111,11111111111111611111111111111,11111111111111173111111111111111 %N A068160 Smallest prime beginning and ending in exactly n 1's and containing at least one digit != 1. %C A068160 a(499) has 1001 digits. - _Michael S. Branicky_, Oct 02 2024 %H A068160 Michael S. Branicky, <a href="/A068160/b068160.txt">Table of n, a(n) for n = 0..498</a> %e A068160 a(2) = 11311 is a prime that starts with 11 and ends in 11 (two 1's). %o A068160 (Python) %o A068160 from gmpy2 import is_prime %o A068160 def a(n): %o A068160 suffix, d = (10**n-1)//9, 2*n+1 %o A068160 while True: %o A068160 prefix = 10**(d-n)*suffix %o A068160 for mid in range(0, 10**(d-n), 10**n): %o A068160 s = str(mid//10**n) %o A068160 if s[0] == "1" or s[-1] == "1": continue %o A068160 t = prefix + mid + suffix %o A068160 if is_prime(t): return t %o A068160 d += 1 %o A068160 print([a(n) for n in range(16)]) # _Michael S. Branicky_, Oct 02 2024 %Y A068160 Cf. A366416. %K A068160 nonn,base %O A068160 0,1 %A A068160 _Amarnath Murthy_, Feb 24 2002 %E A068160 Corrected and extended by _Sascha Kurz_, Jan 03 2003 %E A068160 More precise name and more terms from _Hugo Pfoertner_, Oct 11 2023 %E A068160 a(0) = 2 inserted by _Michael S. Branicky_, Oct 02 2024