login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A028978 Product of prime and previous prime is palindromic. 3

%I #24 Mar 13 2021 12:19:28

%S 3,11,19,193,1061,1934071

%N Product of prime and previous prime is palindromic.

%C No further terms < 4.5*10^8.

%C No further terms < 3.7*10^10. - _Michael S. Branicky_, Mar 11 2021

%C No further terms < 5.7*10^11. - _Jon E. Schoenfield_, Mar 13 2021

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/sequenc.htm">More palindromic products of integer sequences</a>

%e 19 belongs to this sequence as 17*19 = 323.

%t 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 *)

%t Select[Partition[Prime[Range[150000]],2,1],PalindromeQ[Times@@#]&] [[All,2]] (* Requires Mathematica version 10 or later *) (* _Harvey P. Dale_, Oct 26 2020 *)

%o (Python)

%o from sympy import nextprime

%o def ispal(n): s = str(n); return s == s[::-1]

%o def aupto(lim):

%o prevp, p, alst = 2, 3, []

%o while p < lim:

%o if ispal(p * prevp): alst.append(p)

%o prevp, p = p, nextprime(p)

%o return alst

%o print(aupto(2*10**6)) # _Michael S. Branicky_, Mar 11 2021

%Y Cf. A028979, A028888.

%Y Intersection of A006094 and A002113.

%K nonn,base,more

%O 1,1

%A _Patrick De Geest_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 10:38 EDT 2024. Contains 371791 sequences. (Running on oeis4.)