A321210 Palindromic primes in base 10 of the form 6*p+1, where p is a palindromic prime in base 10.
787, 72781818727, 787812181218787, 72781878787818727, 78121818781812187, 78181272727218187, 7278781818181878727, 7872787812187872787, 727872187212781278727, 781272121818121272187, 781272727818727272187, 781872727212727278187, 72121872127872127812127, 72727272187278127272727
Offset: 1
Examples
787 is in the sequence because 787 = 6*131 + 1, where 131 is a palindromic prime.
Links
- Chai Wah Wu, Table of n, a(n) for n = 1..10008
- MathExchange, p and 6p+1 both palindrome primes. Is (131/787) the only example?.
Programs
-
PARI
print1(787", " ); for(u=0, 20, z=[[1, 1], [2, 3]]; for(j=1, u-1, z=concat(z, [[0, 9]])); forvec(j=z, for(k=0, 9, n=0; for(m=1, length(j), n=n*10+j[m]); n=n*10+k; forstep(m=length(j), 1, -1, n=n*10+j[m]); if(digits(6*n+1)==Vecrev(digits(6*n+1)), if(ispseudoprime(n)==1, if(ispseudoprime(6*n+1)==1, print1(6*n+1", " )))))))
-
Python
from sympy import isprime A321210_list = [] for i in range(2**20): s = bin(i)[2:] s += s[-2::-1] p = int(s) + int('02'*(len(s)//2)+'0') q = 6*p+1 t = str(q) if t == t[::-1] and isprime(p) and isprime(q): A321210_list.append(q) # Chai Wah Wu, Dec 06 2019
Extensions
a(5)-a(8) from Giovanni Resta, Oct 31 2018
a(9)-a(14) from Chai Wah Wu, Dec 05 2019
Comments