|
|
A028978
|
|
Product of prime and previous prime is palindromic.
|
|
3
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
No further terms < 4.5*10^8.
|
|
LINKS
|
|
|
EXAMPLE
|
19 belongs to this sequence as 17*19 = 323.
|
|
MATHEMATICA
|
p=2; t={}; Do[q=NextPrime[p]; If[Reverse[x=IntegerDigits[p*q]]==x, AppendTo[t, q]]; p=q, {n, 150000}]; t (* Jayanta Basu, Jun 05 2013 *)
Select[Partition[Prime[Range[150000]], 2, 1], PalindromeQ[Times@@#]&] [[All, 2]] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Oct 26 2020 *)
|
|
PROG
|
(Python)
from sympy import nextprime
def ispal(n): s = str(n); return s == s[::-1]
def aupto(lim):
prevp, p, alst = 2, 3, []
while p < lim:
if ispal(p * prevp): alst.append(p)
prevp, p = p, nextprime(p)
return alst
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,more
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|