|
|
A028888
|
|
Smaller of two successive primes with a palindromic product.
|
|
3
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
17 is in the sequence because 17 * 19 = 323.
19 is not in the sequence because 19 * 23 = 437.
|
|
MATHEMATICA
|
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 *)
Prime[#]&/@Flatten[Position[Times@@@Partition[Prime[Range[1934100]], 2, 1], _?(PalindromeQ[#] &)]] (* Harvey P. Dale, May 14 2019 *)
|
|
PROG
|
(Python)
from sympy import nextprime
def ispal(n): s = str(n); return s == s[::-1]
p, q = 2, 3
while True:
if ispal(p*q): print(p)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|