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.

Showing 1-4 of 4 results.

A068687 Primes which are a sandwich of numbers made of only one digit between two 3's.

Original entry on oeis.org

313, 353, 373, 383, 3222223, 3444443, 322222223, 355555553, 3111111111113, 3444444444443, 3888888888883, 311111111111113, 377777777777773, 3111111111111111111111111111113, 3888888888888888888888888888883
Offset: 1

Views

Author

Amarnath Murthy, Mar 02 2002

Keywords

Comments

a(36) has 1065 digits. - Michael S. Branicky, Jan 28 2023

Crossrefs

Cf. A068685.

Programs

  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): yield from (t for i in count(1) for m in "124578" if isprime(t:=int("3" + m*i + "3")))
    print(list(islice(agen(), 20))) # Michael S. Branicky, Jan 28 2023

Extensions

More terms from Sascha Kurz, Mar 17 2002

A068689 Primes which are a sandwich of numbers made of only one decimal digit between two 9's.

Original entry on oeis.org

919, 929, 9222229, 9888889, 9222222222229, 9888888888888888888888888888888888888888888888888888888888888888888888889
Offset: 1

Views

Author

Amarnath Murthy, Mar 02 2002

Keywords

Comments

Conjecture: Inner digits 1, 2 and 8 are the only repeating digits for which the resulting numbers can be prime for outer digits 9. I.e., 9444..4449, 9555..5559, 9777..7779 are composite. The cases for inner digits 0, 3, 6 and 9 give composite numbers. - Cino Hilliard, Jul 11 2005
a(13) has 1141 digits. - Michael S. Branicky, Jan 28 2023

Crossrefs

Programs

  • PARI
    lista(nn) = my(list = List(), p); for (n=1, nn, for (k=1, 8, my(d=vector(n, i, k)); d = concat(9, d); d = concat(d, 9); if (ispseudoprime(p=fromdigits(d)), listput(list, p)););); Vec(list); \\ Michel Marcus, Jan 28 2023
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): yield from (t for i in count(1) for m in "124578" if isprime(t:=int("9" + m*i + "9")))
    print(list(islice(agen(), 11))) # Michael S. Branicky, Jan 28 2023

Extensions

More terms from Sascha Kurz, Mar 17 2002

A068688 Primes which are a sandwich of numbers made of only one digit between two 7's.

Original entry on oeis.org

727, 757, 787, 797, 72227, 75557, 76667, 78887, 79997, 7666667, 722222227, 74444444447, 75555555557, 755555555555555555557, 75555555555555555555557, 72222222222222222222222222227, 79999999999999999999999999997, 7444444444444444444444444444447
Offset: 1

Views

Author

Amarnath Murthy, Mar 02 2002

Keywords

Comments

The middle digit is never 0, 1, 3, or 7. - Harvey P. Dale, May 05 2018
a(40) has 1213 digits. - Michael S. Branicky, Jan 28 2023

Crossrefs

Programs

  • Mathematica
    Select[Flatten[Table[10FromDigits[PadRight[{7},n,i]]+7,{n,2,100},{i,9}]],PrimeQ] (* Harvey P. Dale, May 05 2018 *)
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): yield from (t for i in count(1) for m in "0123456789" if isprime(t:=int("7" + m*i + "7")))
    print(list(islice(agen(), 30))) # Michael S. Branicky, Jan 28 2023

Extensions

More terms from Sascha Kurz, Mar 17 2002

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.

Original entry on oeis.org

11, 101, 1009, 10007, 100003, 1000003, 13333339, 100000007, 1000000007, 13333333339, 100000000003, 1333333333337, 13333333333339, 122222222222227, 1555555555555553, 16666666666666661, 100000000000000003, 1000000000000000003, 15555555555555555557
Offset: 0

Views

Author

Gonzalo Martínez, Jun 14 2025

Keywords

Comments

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.
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.
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

Crossrefs

Programs

  • Python
    from sympy import isprime
    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)
    print([a(n) for n in range(20)]) # Michael S. Branicky, Jun 14 2025

Formula

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.
Showing 1-4 of 4 results.