A068685 Primes which are a sandwich of numbers using at most one digit between two 1's.
11, 101, 131, 151, 181, 191, 13331, 15551, 16661, 19991, 1333331, 1444441, 1777771, 188888881, 199999991, 1666666666661, 188888888888881, 16666666666666661, 1111111111111111111, 1666666666666666661, 155555555555555555551, 11111111111111111111111
Offset: 1
Examples
11 is a member sandwiching nothing between two 1's. 13331 is a sandwich using 333.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..46
Crossrefs
Cf. A068683.
Programs
-
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 *)
-
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
Extensions
More terms from Sascha Kurz, Mar 17 2002
a(21) and beyond from Michael S. Branicky, Jan 28 2023
Comments