A356750 Palindromic odd numbers with an odd number of distinct prime factors.
3, 5, 7, 9, 11, 101, 121, 131, 151, 181, 191, 313, 343, 353, 373, 383, 525, 555, 585, 595, 727, 757, 777, 787, 797, 919, 929, 969, 1001, 1221, 1331, 1551, 1771, 1881, 3333, 3553, 3663, 5225, 5335, 5445, 5555, 5665, 5885, 5995, 7007, 7227, 7337, 7557, 7667, 7777, 7887, 9339, 9669, 9779, 9889, 9999, 10201, 10301
Offset: 1
Examples
Number 525 = 3*5^2*7 has 3 prime factors 3, 5, and 7. Thus, it is in the sequence.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Select[Range[2,12000], OddQ[#] && PalindromeQ[#] && OddQ[Length[Transpose[FactorInteger[#]][[2]]]] &]
-
PARI
ispal(n) = my(d1=digits(n)); d1 == Vecrev(d1) forstep(k=3,10^6,2,if(ispal(k)&&omega(k)%2==1,print1(k,", "))) \\ Alexandru Petrescu, Sep 10 2022
-
Python
from sympy import isprime, factorint from itertools import count, islice, product def cond(n): return n&1 and (isprime(n) or len(factorint(n))&1) def oddpals(): # generator of odd palindromes yield from [1, 3, 5, 7, 9] for d in count(2): for first in "13579": for p in product("0123456789", repeat=(d-2)//2): left = "".join(p); right = left[::-1] for mid in [[""], "0123456789"][d%2]: yield int(first + left + mid + right + first) def agen(): yield from filter(cond, oddpals()) print(list(islice(agen(), 58))) # Michael S. Branicky, Aug 25 2022
Comments