OFFSET
1,4
COMMENTS
a(k) = 1 for k in A095179. - Michel Marcus, Apr 09 2018
LINKS
Robert Israel, Table of n, a(n) for n = 1..202
FORMULA
a(3k) = a(11k) = 0 for k > 1 because reversion does not make a prime from any of their powers.
EXAMPLE
For n=46, a(46)=22 means that reversion of 46^22 gives a prime: 6100744433653913942689966672393877083.
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 then return 0 fi;
if n mod 10 = 0 then return procname(n/10) 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;
map(f, [$1..100]); # Robert Israel, Apr 09 2018
MATHEMATICA
nd[x_, y_] := 10*x+y; tn[x_] := Fold[nd, 0, x]; bac[x_] := tn[Reverse[IntegerDigits[x]]] t={list without 3k and 11k numbers}; le=Length[t]; Table[f=1; Do[s=bac[Part[t, n]^k]; If[PrimeQ[s]&&Equal[f, 1], Print[{k, Part[t, n], s}]; f=0], {k, 1, 300}], {n, 1, le}]
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Labos Elemer, Jul 02 2003
STATUS
approved