OFFSET
1,2
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..1000
EXAMPLE
Divisors of 1 is 1 and concat(1,1) = 11 is prime.
Divisors of 151 are 1, 151. Then concat(151,1) = 1511 is prime, as is concat(1,151) = 1151, and concat(1,151,51) = 115151 is prime.
Divisors of 169 are 1, 13, 169. Then concat(16,1,9) = 1619 is prime, concat(16,13,9) = 16139 is prime, as is concat(1,13,69) = 11369, and concat(1,169,69) = 116969 is prime.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, f, g, h, j, k, n;
for n from 1 by 2 to q do a:=divisors(n); h:=0;
for k from 1 to nops(a) do b:=ilog10(a[k])+1;
for j from 0 to ilog10(n)+1 do f:=(n mod 10^j);
if j=0 then c:=n*10^b+a[k]; else g:=a[k]*10^(ilog10(f)+1)+f;
c:=trunc(n/10^j)*10^(ilog10(g)+1)+g; fi;
if isprime(c) then h:=h+1; break; fi; od;
if h=nops(a) then print(n); fi; od; od; end: P(10^6);
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Nov 18 2014
EXTENSIONS
Inserted a(3), a(16) and a(26) by Paolo P. Lava, Nov 21 2014
STATUS
approved