login
This site is supported by donations to The OEIS Foundation.

 

Logo

"Email this user" was broken Aug 14 to 9am Aug 16. If you sent someone a message in this period, please send it again.

Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A215421 Primes that remain prime when a single digit 9 is inserted between any two consecutive digits or as the leading or trailing digit. 19
7, 19, 37, 41, 199, 239, 311, 587, 661, 941, 967, 1009, 1997, 4993, 4999, 5393, 5651, 6911, 9109, 9397, 9679, 9829, 19417, 20233, 22549, 27397, 29389, 31387, 39989, 71419, 71569, 90599, 91951, 95369, 97103, 98909, 99023, 160009, 225919, 267389, 313991, 328849 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Harvey P. Dale, Table of n, a(n) for n = 1..100

EXAMPLE

31387 is prime and also 313879, 313897, 313987, 319387, 391387, 931387.

MAPLE

A215421:=proc(q, x)

local a, b, c, d, i, n, ok;

for n from 1 to q do

  a:=ithprime(n); b:=0; while a>0 do b:=b+1; a:=trunc(a/10); od;

  a:=ithprime(n); ok:=1;

  for i from 0 to b do

    c:=a+9*10^i*trunc(a/10^i)+10^i*x; if not isprime(c) then ok:=0; break; fi;

  od;

  if ok=1 then print(ithprime(n)); fi;

od; end:

A215421(1000, 9);

MATHEMATICA

Select[Prime[Range[30000]], AllTrue[FromDigits/@Table[Insert[ IntegerDigits[ #], 9, n], {n, IntegerLength[ #]+1}], PrimeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Oct 22 2016 *)

CROSSREFS

Cf. A215417-A215420

Sequence in context: A124270 A068678 A069833 * A192594 A031337 A241984

Adjacent sequences:  A215418 A215419 A215420 * A215422 A215423 A215424

KEYWORD

nonn,base

AUTHOR

Paolo P. Lava, Aug 10 2012

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent | More pages
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy .

Last modified August 20 11:44 EDT 2017. Contains 290835 sequences.