OFFSET
2,1
COMMENTS
Using a representation where the digits of the prime are written between "[" and "]_" separated by commas with the base following the "_" then by checking up to a base of 7000 (where the lowest prime palindrome is [1, 1]_7000):
1) Either the palindrome is [1, 1]_n where n is one less than a prime number, or [1, X, 1]_n where X << n, asymptotically.
2) Many prime numbers occur more than once, e.g.,
13 is [1, 1, 1]_3 and [1, 1]_12;
71 is [1, 3, 1]_7 and [1, 1]_70;
1471 is [1, 7, 1]_35 and [1, 1]_1470.
LINKS
Colin M Ready, Table of n, a(n) for n = 2..7000
FORMULA
a(p-1) = p for prime p > 2.
a(n) <= A087952(n) with equality if n+1 is not prime. - M. F. Hasler, Feb 27 2020
EXAMPLE
a(2) = 3 which is 11 in binary, a(3) = 13 which is 111 in ternary, a(4) = 5 which is 11 in quaternary, a(16) = 17 which is 11 in hexadecimal.
If we use the representation described earlier, then:
a(2) = 3 is [1, 1]_2,
a(3) = 13 is [1, 1, 1]_3,
a(4) = 5 is [1, 1]_4,
a(11) = 199 is [1, 7, 1]_11,
a(13) = 313 is [1, 11, 1]_13,
a(16) = 17 is [1, 1]_16,
a(48) = 2593 is [1, 6, 1]_48.
MATHEMATICA
Array[If[PrimeQ[# + 1], # + 1, Block[{p = If[PrimeQ@ #1, #1, Prime[#2 + 1]] & @@ {#, PrimePi[#]}}, While[! PalindromeQ@ IntegerDigits[p, #], Set[p, NextPrime@ p]]; p]] &, 55, 2] (* Michael De Vlieger, Jan 27 2020 *)
PROG
(PARI) a(n) = {forprime(p=n+1, oo, my(d=digits(p, n)); if (Vecrev(d) ==d, return(p)); ); } \\ Michel Marcus, Jan 27 2020
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Colin M Ready, Jan 27 2020
STATUS
approved