A046338 Palindromes > 0 with an even number of prime factors (counted with multiplicity).
1, 4, 6, 9, 22, 33, 55, 77, 88, 111, 121, 141, 161, 202, 232, 262, 303, 323, 393, 414, 424, 444, 454, 484, 505, 515, 525, 535, 545, 565, 585, 626, 636, 666, 676, 686, 707, 717, 737, 767, 808, 818, 838, 858, 868, 878, 898, 939, 949, 959, 979, 989, 999, 1111, 1441
Offset: 1
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..17500 (terms 1..10000 from John Cerkan)
Programs
-
Mathematica
Select[Range[1500],PalindromeQ[#]&&EvenQ[PrimeOmega[#]]&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Jan 01 2020 *)
-
Python
from sympy import factorint from itertools import product def ispal(n): s = str(n); return s == s[::-1] def pals(d, base=10): # all d-digit palindromes digits = "".join(str(i) for i in range(base)) for p in product(digits, repeat=d//2): if d > 1 and p[0] == "0": continue left = "".join(p); right = left[::-1] for mid in [[""], digits][d%2]: yield int(left + mid + right) def ok(pal): return sum(factorint(pal).values())%2 == 0 print(list(filter(ok, (p for d in range(1, 5) for p in pals(d) if ok(p))))) # Michael S. Branicky, Aug 14 2022
Extensions
Corrected by Harvey P. Dale, Jan 01 2020