# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a058998 Showing 1-1 of 1 %I A058998 #39 Mar 22 2020 12:15:40 %S A058998 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, %T A058998 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, %U A058998 8,0,39,83,0,0,1,0,1,1,0 %N A058998 Least exponent k for which n^k reversed (leading zeros are not allowed) is a prime, or 0 if impossible. %C A058998 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). %H A058998 Robert Israel, Table of n, a(n) for n = 1..168 %F A058998 a(n*10^k) = 0 for all k > 0 since definition does not allow leading 0's. %e A058998 a(4) is 2, because 4^2 is 16, and 16 reversed is 61 which is prime. %p A058998 Rev:= proc(n) local L; %p A058998 L:= convert(n,base,10); %p A058998 add(L[-i]*10^(i-1),i=1..nops(L)) %p A058998 end proc: %p A058998 f:= proc(n) local k; %p A058998 if igcd(n,33) <> 1 or (n/10)::integer then return 0 fi; %p A058998 for k from 1 do if isprime(Rev(n^k)) then return k fi od: %p A058998 end proc: %p A058998 f(1):= 0: f(3):= 1: f(11):= 1: %p A058998 map(f, [$1..168]); # _Robert Israel_, Apr 08 2018 %t A058998 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} ] %Y A058998 Cf. A085324. %K A058998 base,nonn %O A058998 1,4 %A A058998 _Robert G. Wilson v_, Jan 17 2001 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE