A085298 a(n) is the smallest exponent x such that prime(n)^x when reversed is a prime.
1, 1, 1, 1, 1, 1, 1, 2, 8, 7, 1, 1, 2, 5, 15, 10, 12, 4, 39, 1, 1, 1, 11, 2, 1, 1, 10, 1, 23, 1, 5, 1, 243, 2, 1, 1, 1, 23, 1, 34, 1, 1, 1, 2, 58, 1, 3, 9, 166, 17, 68, 8, 8, 3, 7, 5, 5, 2, 2, 2, 61, 11, 97, 1, 1, 10, 2, 1, 1, 41, 1, 1, 66, 1, 5, 1, 1, 2, 2, 8, 40, 2, 8, 19, 2, 2, 723
Offset: 1
Examples
a(n)=1 means that rev(prime(n)) is prime i.e. prime(n) is in A007500; a(n)=2 means that rev(prime(n)^2) is prime but rev(prime(n)) is not, like n=8:p=19 and 91 is not a prime but rev[19^2]=rev[361]=163 is a prime; For n, the first k exponent providing rev(prime(n)^k) prime can be quite large, like at n=87: rev(p(87)^723)=rev(449^723) is the first [probably] prime has 1918 decimal digits: 948......573.
Links
- Giovanni Resta, Table of n, a(n) for n = 1..100
Crossrefs
Programs
-
Maple
a:= proc(n) local k, p; p:= ithprime(n); for k while not isprime((s-> parse(cat(seq(s[-i], i=1..length(s)))))(""||(p^k))) do od; k end: seq(a(n), n=1..50); # Alois P. Heinz, Sep 04 2019
-
Mathematica
a[n_] := Block[{k = 1}, While[! PrimeQ@ FromDigits@ Reverse@ IntegerDigits[ Prime[n]^k], k++]; k]; Array[a, 87] (* Giovanni Resta, Sep 04 2019 *)
-
PARI
a(n) = {my(x=1, p=prime(n)); while (!ispseudoprime(fromdigits(Vecrev(digits(p^x)))), x++); x;} \\ Michel Marcus, Sep 04 2019
Formula
a(n) = Min{x; reversed(prime(n)^x) is a prime}.
Comments