|
|
A058998
|
|
Least exponent k for which n^k reversed (leading zeros are not allowed) is a prime, or 0 if impossible.
|
|
1
|
|
|
0, 1, 1, 2, 1, 0, 1, 8, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 2, 0, 0, 0, 8, 0, 13, 47, 0, 2, 7, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 2, 0, 5, 0, 0, 22, 15, 0, 6, 0, 0, 3, 10, 0, 0, 143, 0, 88, 12, 0, 4, 2, 0, 4, 8, 0, 39, 83, 0, 0, 1, 0, 1, 1, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
COMMENTS
|
There are two different versions of this sequence: A085324 and this sequence which agrees with A085324 on the first 19 terms, but differs at a(20).
|
|
LINKS
|
|
|
FORMULA
|
a(n*10^k) = 0 for all k > 0 since definition does not allow leading 0's.
|
|
EXAMPLE
|
a(4) is 2, because 4^2 is 16, and 16 reversed is 61 which is prime.
|
|
MAPLE
|
Rev:= proc(n) local L;
L:= convert(n, base, 10);
add(L[-i]*10^(i-1), i=1..nops(L))
end proc:
f:= proc(n) local k;
if igcd(n, 33) <> 1 or (n/10)::integer then return 0 fi;
for k from 1 do if isprime(Rev(n^k)) then return k fi od:
end proc:
f(1):= 0: f(3):= 1: f(11):= 1:
|
|
MATHEMATICA
|
Do[ If[ Mod[ n, 3 ] != 0 && Mod[ n, 10 ] != 0 && Mod[ n, 11 ] != 0, k = 1; While[ !PrimeQ[ ToExpression[ StringReverse[ ToString[ n^k ] ] ] ], k++ ]; Print[ k ], Print[ 0 ] ], {n, 2, 75} ]
|
|
CROSSREFS
|
|
|
KEYWORD
|
base,nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|