OFFSET
1,1
COMMENTS
Except for 11, every palindrome with an even number of digits is composite because divisible by 11; also, 11 that is the only palindromic prime with an even number of digits does not belong to this sequence because 10 is squarefree, hence all the terms of this sequence have an odd number of digits. - Bernard Schott, Feb 27 2020
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..1446
G. L. Honaker, Jr. and Chris K. Caldwell, Prime Curios! 151
MATHEMATICA
squarefulQ[n_] := Last[Sort[Transpose[FactorInteger[n]][[2]]]] > 1; palindromeQ[n_] := Reverse[IntegerDigits[n]] == IntegerDigits[n]; Select[Range[3, 2000000], palindromeQ[ # ] && squarefulQ[ # - 1] && squarefulQ[ # + 1] && PrimeQ[ # ] &]
Select[Prime[Range[90000]], PalindromeQ[#]&&NoneTrue[#+{1, -1}, SquareFreeQ]&] (* Harvey P. Dale, Jul 19 2024 *)
PROG
(Python)
from sympy import isprime, factorint
def palgen10odd(l): # generator of palindromes in base 10 of odd length <= 2*l
if l > 0:
yield 0
for x in range(1, l+1):
for y in range(10**(x-1), 10**x):
s = str(y)
yield int(s+s[-2::-1])
A130870_list = []
for i in palgen10odd(5):
if i > 2 and isprime(i) and max(factorint(i-1).values()) > 1 and max(factorint(i+1).values()) > 1:
A130870_list.append(i) # Chai Wah Wu, Jun 09 2015
(PARI) isok(p) = isprime(p) && (p==fromdigits(Vecrev(digits(p)))) && !issquarefree(p-1) && !issquarefree(p+1); \\ Michel Marcus, Feb 27 2020
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Tanya Khovanova, Jul 24 2007
STATUS
approved