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

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A216165 Composite numbers and 1 which yield a prime whenever a 1 is inserted anywhere in them, including at the beginning or end. 5
1, 49, 63, 81, 91, 99, 117, 123, 213, 231, 279, 319, 427, 459, 621, 697, 721, 801, 951, 987, 1113, 1131, 1261, 1821, 1939, 2101, 2149, 2211, 2517, 2611, 3151, 3219, 4011, 4411, 4887, 5031, 5361, 6231, 6487, 7011, 7209, 8671, 9141, 9801, 10051, 10161, 10281 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

LINKS

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

EXAMPLE

7209 is not prime but 72091, 72019, 72109, 71209 and 17209 are all primes.

MAPLE

with(numtheory);

A216165:=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:

A216165(1000, 1);

MATHEMATICA

Join[{1}, Select[Range[11000], CompositeQ[#]&&AllTrue[FromDigits/@ Table[ Insert[ IntegerDigits[#], 1, i], {i, IntegerLength[#]+1}], PrimeQ]&]] (* Harvey P. Dale, Mar 24 2017 *) (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Mar 24 2017 *)

PROG

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

CROSSREFS

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

Sequence in context: A178951 A202001 A038640 * A065807 A038678 A225120

Adjacent sequences:  A216162 A216163 A216164 * A216166 A216167 A216168

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 July 25 12:29 EDT 2017. Contains 289795 sequences.