login
A068685
Primes which are a sandwich of numbers using at most one digit between two 1's.
4
11, 101, 131, 151, 181, 191, 13331, 15551, 16661, 19991, 1333331, 1444441, 1777771, 188888881, 199999991, 1666666666661, 188888888888881, 16666666666666661, 1111111111111111111, 1666666666666666661, 155555555555555555551, 11111111111111111111111
OFFSET
1,1
COMMENTS
a(47) has 1003 digits. - Michael S. Branicky, Jan 28 2023
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..46
EXAMPLE
11 is a member sandwiching nothing between two 1's. 13331 is a sandwich using 333.
MATHEMATICA
Select[Union[Flatten[Table[FromDigits[Join[{1}, PadRight[{}, n, i], {1}]], {n, 0, 20}, {i, 0, 9}]]], PrimeQ] (* Harvey P. Dale, Mar 29 2012 *)
PROG
(Python)
from sympy import isprime
from itertools import count, islice
def agen(): yield 11; yield from (t for i in count(1) for m in "0123456789" if isprime(t:=int("1" + m*i + "1")))
print(list(islice(agen(), 30))) # Michael S. Branicky, Jan 28 2023
CROSSREFS
Cf. A068683.
Sequence in context: A062332 A222723 A088281 * A109830 A052035 A083144
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Mar 02 2002
EXTENSIONS
More terms from Sascha Kurz, Mar 17 2002
a(21) and beyond from Michael S. Branicky, Jan 28 2023
STATUS
approved