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
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Sep 03 2012
STATUS
approved