%I #27 Feb 07 2021 14:57:28
%S 2,7,17,191,1051,1934063
%N Smaller of two successive primes with a palindromic product.
%C No further terms less than 1.38 * 10^10. - _Michael S. Branicky_, Feb 07 2021
%H Patrick De Geest, <a href="http://www.worldofnumbers.com/sequenc.htm">More palindromic products of integer sequences</a>
%e 17 is in the sequence because 17 * 19 = 323.
%e 19 is not in the sequence because 19 * 23 = 437.
%t p = 2; t = {}; Do[q = NextPrime[p]; If[Reverse[x = IntegerDigits[p * q]] == x, AppendTo[t, p]]; p = q, {n, 150000}]; t (* _Jayanta Basu_, Jun 05 2013 *)
%t Prime[#]&/@Flatten[Position[Times@@@Partition[Prime[Range[1934100]], 2, 1], _?(PalindromeQ[#] &)]] (* _Harvey P. Dale_, May 14 2019 *)
%o (Python)
%o from sympy import nextprime
%o def ispal(n): s = str(n); return s == s[::-1]
%o p, q = 2, 3
%o while True:
%o if ispal(p*q): print(p)
%o p, q = q, nextprime(q) # _Michael S. Branicky_, Feb 07 2021
%Y Cf. A028978, A028979.
%K nonn,base,more
%O 1,1
%A _Patrick De Geest_
%E Edited by _N. J. A. Sloane_, May 04 2007
|