OFFSET
1,1
LINKS
Carlos Rivera, Puzzle 25. Composed primes (by G.L. Honaker, Jr.), The Prime Puzzles and Problems Connection.
EXAMPLE
38 = 19 * 2 and 8^19 + 3^2 = 144115188075855881 is prime;
110 = 11 * 5 * 2 and 0^11 + 1^5 + 1^2 = 2 is prime;
175 = 7 * 5 * 5 and 5^7 + 7^5 + 1^5 = 94933 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);
for k from 1 to trunc(nops(d)/2) do b:=d[k]; d[k]:=d[nops(d)-k+1]; d[nops(d)-k+1]:=b; od;
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[ d^Flatten[#[[1]] + 0 Range@#[[2]] & /@ f]]]; Select[ Range@ 7550, ok] (* Giovanni Resta, Mar 17 2017 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Paolo P. Lava, Mar 17 2017
STATUS
approved