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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A216167 Composite numbers which yield a prime whenever a 5 is inserted anywhere in them, excluding at the end. 3
9, 21, 57, 63, 69, 77, 87, 93, 153, 231, 381, 407, 413, 417, 501, 531, 581, 651, 669, 741, 749, 783, 791, 987, 1241, 1551, 1797, 1971, 2189, 2981, 3381, 3419, 3591, 3951, 4083, 4503, 4833, 4949, 4959, 5049, 5117, 5201, 5229, 5243, 5529, 5547, 5603, 5691, 5697 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

LINKS

Paolo P. Lava, Table of n, a(n) for n = 1..300

EXAMPLE

4083 is not prime but 40853, 40583, 45083 and 54083 are all primes.

MAPLE

with(numtheory);

A216167:=proc(q, x)

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

for n from 1 to q do

if not isprime(n) then

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

  for i from 1 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(n); fi;

fi;

od; end:

A216167(1000, 5);

PROG

(MAGMA) [n: n in [1..6000] | not IsPrime(n) and forall{m: t in [1..#Intseq(n)] | IsPrime(m) where m is (Floor(n/10^t)*10+5)*10^t+n mod 10^t}]; // Bruno Berselli, Sep 03 2012

CROSSREFS

Cf. A068673, A068674, A068677, A068679, A069246, A215417, A215419-A215421, A216165, A216166, A216168, A216169.

Sequence in context: A134717 A216980 A147169 * A246327 A127989 A147337

Adjacent sequences:  A216164 A216165 A216166 * A216168 A216169 A216170

KEYWORD

nonn,base

AUTHOR

Paolo P. Lava, Sep 03 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 June 24 08:22 EDT 2017. Contains 288697 sequences.