login
A059004
Smallest prime whose reversal is an n-th power.
1
2, 61, 521, 61, 23, 61277761, 821, 61277761, 23888027348153, 4201, 33670369817243, 61277761, 5265674839116110941, 441435249928911950281, 23888027348153, 1232787935486158110509626783, 270131
OFFSET
1,1
LINKS
MAPLE
revdigs:= proc(n) local L, k;
L:= convert(n, base, 10);
add(L[-k]*10^(k-1), k=1..nops(L))
end proc:
f:= proc(n) local d, k, wmin, v, w;
wmin:= infinity;
for d from 1 do
for k from ceil(10^(d/n)) do
v:= k^n;
if v >= 10^(d+1) then break fi;
w:= revdigs(v);
if isprime(w) and w < wmin then wmin:= w fi;
od;
if wmin < infinity then return wmin fi
od
end proc:
map(f, [$1..20]); # Robert Israel, May 22 2019
MATHEMATICA
Do[ k = 1; While[ r = ToExpression[ StringReverse[ ToString[ k^n ] ] ]; ! PrimeQ[ r ], k++ ]; Print[ r ], {n, 1, 25} ]
CROSSREFS
Cf. A007488.
Sequence in context: A279624 A088078 A172230 * A297919 A298543 A298333
KEYWORD
nonn,base
AUTHOR
Robert G. Wilson v, Jan 16 2001
STATUS
approved