OFFSET
1,1
COMMENTS
All palindromic primes are terms of this sequence. - Harvey P. Dale, Jun 30 2022
Other than 2*10^i and 5*10^i, for i >= 0, all terms must begin with 1, 3, 7, or 9. - Michael S. Branicky, Sep 23 2024
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..700 from Harvey P. Dale)
EXAMPLE
Reverse(110) = 11 is a prime factor of 110, so 110 is a term of the sequence.
MATHEMATICA
r = {}; Do[m = FromDigits[Reverse[IntegerDigits[n]]]; If[PrimeQ[m] && Mod[n, m] == 0, r = Append[r, n]], {n, 1, 10^4}]; r
Select[Range[2, 10000], MemberQ[FactorInteger[#][[All, 1]], IntegerReverse[#]]&] (* Harvey P. Dale, Jun 30 2022 *)
PROG
(Python)
from sympy import isprime
def ok(n): return (r:=int(str(n)[::-1])) <= n and n%r == 0 and isprime(r)
print([k for k in range(1, 10**4) if ok(k)]) # Michael S. Branicky, Sep 23 2024
(Python) # uses ok, import above
from itertools import count, islice
def agen(): # generator of terms
for e in count(1):
for f in [1, 2, 3, 5, 7, 9]:
base = f*10**(e-1)
if f in {2, 5}: yield base; continue
for k in range(base, base+10**(e-1)):
if ok(k): yield k
print(list(islice(agen(), 50))) # Michael S. Branicky, Sep 23 2024
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Joseph L. Pe, Jul 14 2002
EXTENSIONS
Offset corrected by Sean A. Irvine, Sep 22 2024
STATUS
approved