A046350 Odd composite numbers with only palindromic prime factors.
9, 15, 21, 25, 27, 33, 35, 45, 49, 55, 63, 75, 77, 81, 99, 105, 121, 125, 135, 147, 165, 175, 189, 225, 231, 243, 245, 275, 297, 303, 315, 343, 363, 375, 385, 393, 405, 441, 453, 495, 505, 525, 539, 543, 567, 573, 605, 625, 655, 675, 693, 707, 729, 735, 755
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Programs
-
Mathematica
palQ[n_]:=Reverse[x=IntegerDigits[n]]==x; Select[Range[9,755,2],!PrimeQ[#]&&And@@palQ/@First/@FactorInteger[#]&] (* Jayanta Basu, Jun 05 2013 *) Select[Range[9,800,2],CompositeQ[#]&&AllTrue[FactorInteger[#][[All,1]], PalindromeQ]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Mar 08 2018 *)
-
Python
from sympy import isprime, primefactors def pal(n): s = str(n); return s == s[::-1] def ok(n): return not isprime(n) and all(pal(f) for f in primefactors(n)) print(list(filter(ok, range(9, 756, 2)))) # Michael S. Branicky, Apr 06 2021