OFFSET
1,1
COMMENTS
Palindromization is the function that extends the string representation of a number into a palindrome.
Even palindromization is the concatenation of a number and its reversal. Odd palindromization excludes the first digit of the reversal.
LINKS
Michel Marcus, Table of n, a(n) for n = 1..11962
MATHEMATICA
Select[Prime@Range[5, 500], Or@@(PrimeQ/@FromDigits/@(Join[a, Reverse@#]&/@{a=IntegerDigits@#, Most@a}))&] (* Giorgos Kalogeropoulos, Mar 30 2021 *)
plndrQ[n_]:=Module[{a=n 10^IntegerLength[n]+IntegerReverse[n], b=n 10^ (IntegerLength[ n]-1)+IntegerReverse[Floor[n/10]]}, AnyTrue[{a, b}, PrimeQ]]; Select[Prime[Range[5, 500]], plndrQ] (* Harvey P. Dale, Nov 20 2022 *)
PROG
(PARI) rev(x) = strjoin(Vecrev(Str(x)));
isok(p) = isprime(p) && (isprime(eval(Str(p, rev(p)))) || isprime(eval(Str(p, rev(p\10)))));
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Michel Marcus, Mar 30 2021
STATUS
approved