A321367 Palindromic primes p such that the highest factor of p+1 is a palindromic prime and the highest factor of p-1 is also a palindromic prime.
3, 5, 7, 11, 383, 38783, 12211811221, 18345254381, 36729292763, 70381018307, 1852347432581, 1874989894781, 115582393285511, 164257606752461, 187610727016781, 199239838932991, 374147565741473, 396089252980693, 15243433533434251, 18741272727214781, 32547212721274523
Offset: 1
Examples
383 is in the sequence because the highest factor of 383+1 is 3, which is a palindromic prime and the highest factor of 383-1 is 191, which is a palindromic prime.
Programs
-
Mathematica
Select[Prime@ Range[10^4], AllTrue[{FactorInteger[# - 1][[-1, 1]], #, FactorInteger[# + 1][[-1, 1]]}, And[PrimeQ@ #, PalindromeQ@ #] &] &] (* Michael De Vlieger, Nov 13 2018 *)
-
PARI
forprime(n=3,10^9,if(Vecrev(digits(n))==digits(n),s=factor(n-1);t=factor(n+1);s=component(s,1);t=component(t,1);s=s[length(s)];t=t[length(t)];if(Vecrev(digits(s))==digits(s),if(Vecrev(digits(t))==digits(t),print1(n," , ")))))
Extensions
a(11)-a(21) from Giovanni Resta, Nov 08 2018