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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A216168 Composite numbers and 1 which yield a prime whenever a 7 is inserted anywhere in them, including at the beginning or end. 3
1, 9, 27, 33, 39, 57, 87, 159, 177, 187, 603, 717, 753, 949, 1257, 1707, 2277, 2367, 4317, 4623, 4779, 4797, 5773, 6757, 6777, 7017, 7471, 7479, 7747, 7797, 7813, 7977, 8797, 9777, 9987, 10777, 11757, 17679, 28269, 28437, 29779, 34177, 34771, 40059, 41721 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

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

EXAMPLE

4623 is not prime but 46237, 46273, 46723, 47623 and 74623 are all primes.

MAPLE

with(numtheory);

A216168:=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 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(n); fi;

fi;

od; end:

A216168(1000, 7);

PROG

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

CROSSREFS

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

Sequence in context: A276003 A255343 A108107 * A036303 A116455 A103753

Adjacent sequences:  A216165 A216166 A216167 * A216169 A216170 A216171

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
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 20 09:12 EDT 2019. Contains 324234 sequences. (Running on oeis4.)