A059215 Least number k such that k^n reversed is a prime.
2, 4, 5, 2, 2, 16, 2, 8, 32, 2, 17, 4, 25, 28, 8, 53, 2, 25, 79, 95, 47, 46, 28, 2, 19, 5, 85, 86, 541, 32, 104, 314, 25, 115, 4, 5, 2, 25, 67, 71, 142, 226, 5, 53, 2, 304, 14, 106, 85, 8, 238, 128, 185, 23, 2, 65, 565, 122, 136, 668, 23, 37, 28, 1117, 178, 5, 74
Offset: 1
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A004086.
Programs
-
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 *)
-
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
Extensions
a(51) and beyond from Michael S. Branicky, Jul 16 2023
Comments