OFFSET
1,1
LINKS
Carlos Rivera, Puzzle 25. Composed primes (by G.L. Honaker, Jr.), The Prime Puzzles and Problems Connection.
EXAMPLE
14 = 2 * 7 and 4^2 + 1^7 = 17 is prime;
102 = 2 * 3 * 17 = 2^2 + 0^3 + 1^17 = 5 is prime;
110 = 2 * 5 * 11 and 0^2 + 1^5 + 1^11 = 2 is prime.
MAPLE
with(numtheory): P:=proc(q) local a, b, c, d, j, k; global n; a:=0; k:=0;
for n from 12 to q do a:=ifactors(n)[2]; if ilog10(n)+1=bigomega(n) then d:=[];
for k from 1 to nops(a) do for j from 1 to a[k][2] do d:=[op(d), a[k][1]]; od; od; d:=sort(d);
b:=n; c:=0; for k from 1 to ilog10(n)+1 do c:=c+(b mod 10)^d[k]; b:=trunc(b/10); od;
if isprime(c) then print(n); fi; fi; od; end: P(10^5);
MATHEMATICA
ok[n_] := Block[{f = FactorInteger@n, d = IntegerDigits@n}, Total[Last /@ f] == Length@d && PrimeQ@ Total[ Reverse[d]^ Flatten[#[[1]] + 0 Range@#[[2]] & /@ f]]]; Select[ Range[10^4], ok] (* Giovanni Resta, Mar 17 2017 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Mar 17 2017
STATUS
approved