%I #10 Mar 10 2020 12:55:57
%S 151,727,919,10601,14741,15451,15551,16361,16561,19891,30403,31013,
%T 33533,34543,35153,39293,70507,71317,72227,73637,75557,78787,79397,
%U 93139,94049,94349,94649,94849,94949,95959,97579,1022201,1055501
%N Palindromic primes with squareful neighbors.
%C Sequence is the intersection of A075432 and A002385. - _Chai Wah Wu_, Jun 09 2015
%C 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 72020
%H Chai Wah Wu, <a href="/A130870/b130870.txt">Table of n, a(n) for n = 1..1446</a>
%H G. L. Honaker, Jr. and Chris K. Caldwell, <a href="https://primes.utm.edu/curios/page.php?curio_id=4502">Prime Curios! 151</a>
%t 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[ # ] &]
%o (Python)
%o from sympy import isprime, factorint
%o def palgen10odd(l): # generator of palindromes in base 10 of odd length <= 2*l
%o ....if l > 0:
%o ........yield 0
%o ........for x in range(1,l+1):
%o ............for y in range(10**(x-1),10**x):
%o ................s = str(y)
%o ................yield int(s+s[-2::-1])
%o A130870_list = []
%o for i in palgen10odd(5):
%o ....if i > 2 and isprime(i) and max(factorint(i-1).values()) > 1 and max(factorint(i+1).values()) > 1:
%o ........A130870_list.append(i) # _Chai Wah Wu_, Jun 09 2015
%o (PARI) isok(p) = isprime(p) && (p==fromdigits(Vecrev(digits(p)))) && !issquarefree(p-1) && !issquarefree(p+1); \\ Michel Marcus, Feb 27 2020
%Y Cf. A075432, A013929, A075432.
%K base,nonn
%O 1,1
%A _Tanya Khovanova_, Jul 24 2007
|