OFFSET
1,1
COMMENTS
a(2) = 2 since 1^2, 2^2, 3^2 and 4^2 reversed are 1, 4, 9 and 61 and 61 is the first prime.
a(3) = 5 since 1^3, 2^3, 3^3, 4^3, and 5^3 reversed are 1, 8, 72, 46 and 521 and 521 is the first prime.
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..1000
MATHEMATICA
Do[ k = 2; While[ ! PrimeQ[ ToExpression[ StringReverse[ ToString[ k^n ] ] ] ], k++ ]; Print[ k ], {n, 1, 50} ]
lnk[n_]:=Module[{k=1}, While[!PrimeQ[IntegerReverse[k^n]], k++]; k]; Array[ lnk, 50] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 20 2021 *)
PROG
(Python)
from itertools import count
from gmpy2 import digits, is_prime
def a(n): return next(k for k in count(2) if is_prime(int(digits(k**n)[::-1])))
print([a(n) for n in range(1, 68)]) # Michael S. Branicky, Jul 16 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Jan 16 2001
EXTENSIONS
a(51) and beyond from Michael S. Branicky, Jul 16 2023
STATUS
approved