OFFSET
1,1
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..200
EXAMPLE
23^1 = 23 = concat(2,3);
5^2 = 25 = concat(2,5);
3^3 = 27 = concat(2,7).
MAPLE
with(numtheory): P:= proc(q) local a, k, n, ok;
for a from 1 to q do for n from 1 to q do if isprime(n) then ok:=0;
for k from 1 to ilog10(n^a) do if isprime(trunc(n^a/10^k)) and isprime(n^a mod 10^k) then ok:=1; break; fi; od;
if ok=1 then lprint(a, n); break; fi; fi; od; od; end: P(10^9);
MATHEMATICA
mp[n_]:=Module[{p=2}, While[Count[PrimeQ[#]&/@Table[FromDigits/@ TakeDrop[ IntegerDigits[ p^n], i], {i, IntegerLength[p^n]}], {True, True}]== 0, p= NextPrime[ p]]; p]; Array[mp, 70] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 13 2016 *)
PROG
(PARI) a(n) = {forprime(p=2, , my(pn = p^n); for (k=1, #Str(pn), if (isprime(pn\10^k) && isprime(pn % 10^k), return (p)); ); ); } \\ Michel Marcus, Oct 22 2015
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Oct 21 2015
STATUS
approved