A032682 Numbers k such that k surrounded by digit '1' is a prime.
0, 3, 5, 8, 9, 15, 17, 18, 20, 23, 29, 30, 32, 36, 38, 45, 47, 48, 51, 53, 57, 60, 62, 72, 74, 80, 81, 83, 86, 87, 90, 93, 95, 107, 113, 116, 117, 125, 126, 131, 132, 135, 141, 147, 149, 155, 162, 168, 170, 173, 180, 182, 183, 194, 197, 198, 201, 204, 207, 210
Offset: 1
Links
- Daniel Starodubtsev, Table of n, a(n) for n = 1..10000
Programs
-
Maple
t0:=[]; u0:=[]; for n from 1 to 100 do t1:=cat(1,n,1); t1:=convert(t1,decimal,10); if isprime(t1) then t0:=[op(t0),n]; u0:=[op(u0),t1]; fi; od: t0;
-
Mathematica
Select[Range[0,210],PrimeQ[FromDigits[Join[{1},IntegerDigits[#],{1}]]]&] (* Jayanta Basu, Jun 02 2013 *)
-
Python
from sympy import isprime print([i for i in range(200) if isprime(int('1' + str(i) + '1'))]) # Daniel Starodubtsev, Apr 05 2020