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
-
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
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
-
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
-
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
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
-
Select[Flatten[Table[10FromDigits[PadRight[{7},n,i]]+7,{n,2,100},{i,9}]],PrimeQ] (* Harvey P. Dale, May 05 2018 *)
-
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
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
-
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
Showing 1-4 of 4 results.
Comments