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.

A384979 a(n) is the smallest (n+2)-digit prime consisting of a string of n identical digits d sandwiched between two digits different from d, or -1 if no such prime exists.

This page as a plain text file.
%I A384979 #39 Jul 01 2025 01:07:12
%S A384979 11,101,1009,10007,100003,1000003,13333339,100000007,1000000007,
%T A384979 13333333339,100000000003,1333333333337,13333333333339,
%U A384979 122222222222227,1555555555555553,16666666666666661,100000000000000003,1000000000000000003,15555555555555555557
%N A384979 a(n) is the smallest (n+2)-digit prime consisting of a string of n identical digits d sandwiched between two digits different from d, or -1 if no such prime exists.
%C A384979 Unlike A300102, where the central string contains only zeros, in this sequence the central string can be any digit d, which gives more combinations to find primes sandwiched between two digits that are different from the central string.
%C A384979 As n grows, these primes tend to become sparser, where a(94) is the first term for which k does not exist. Specifically, a(n) = -1, only for 1 term for n < 100 and for 479 terms for n < 1000.
%C A384979 For each n >= 1, there are a fixed number (657) of possible candidates to test for primality; this, plus the increasing sparsity of primes themselves as their number of digits grows, accounts for the pattern noted above. - _Michael S. Branicky_, Jun 25 2025
%H A384979 Gonzalo Martínez, <a href="/A384979/b384979.txt">Table of n, a(n) for n = 0..1000</a>
%F A384979 a(n) <= A300102(n), for all n >= 0, with equality when the central string of a(n) is zero and A300102(n) has n+2 digits.
%o A384979 (Python)
%o A384979 from sympy import isprime
%o A384979 def a(n): return next((t for l in "123456789" for d in "0123456789" if d!=l for r in "123456789" if r!=d and isprime(t:=int(l+d*n+r))), -1)
%o A384979 print([a(n) for n in range(20)]) # _Michael S. Branicky_, Jun 14 2025
%Y A384979 Cf. A300102, A068685.
%K A384979 nonn,base
%O A384979 0,1
%A A384979 _Gonzalo Martínez_, Jun 14 2025