%I #15 Apr 06 2020 10:27:08
%S 89,107,139,141,169,189,223,249,267,313,379,383,403,453,497,587,589,
%T 633,667,751,757,763,799,859,893,899,913,959,961,977,979,981,983,989,
%U 991,1003,1007,1009,1041,1049,1063,1067,1087,1093,1107,1109,1123,1127
%N Exactly 1 digit from {1,2,3,4,5,6,7,8,9} can precede a term to form a prime.
%H Daniel Starodubtsev, <a href="/A032691/b032691.txt">Table of n, a(n) for n = 1..10000</a>
%e For term 1127, we find only '9'1127 to be prime.
%t aQ[n_] := Total@Boole@PrimeQ[Table[FromDigits[Prepend[IntegerDigits[n], i]], {i,9}]] == 1; Select[Range[1130], aQ[#]&] (* _Jayanta Basu_, Jun 03 2013 *)
%o (Python)
%o from sympy import isprime
%o print([i for i in range(1000) if [isprime(int(j + str(i))) for j in '123456789'].count(True) == 1]) # _Daniel Starodubtsev_, Apr 06 2020
%Y Cf. A088602.
%K nonn,base
%O 1,1
%A _Patrick De Geest_, May 15 1998
|