A075808 Palindromic odd composite numbers that are the products of an odd number of distinct primes.
555, 595, 777, 969, 1001, 1221, 1551, 1771, 3333, 3553, 5335, 5555, 5665, 5885, 5995, 7337, 7557, 7667, 7777, 7887, 9339, 9669, 9779, 9889, 11211, 11811, 12121, 12621, 12921, 13731, 14241, 14541, 15051, 15951, 16261, 16761, 17171, 18381
Offset: 1
Examples
555 = 3*5*37, 595 = 5*7*17 and 777 = 3*7*37 are palindromic, odd, composite and products of an odd number of distinct primes. 50505 = 3 * 5 * 7 * 13 * 37 is the first term with five factors. 125 = 5^3 and 5445 = 3^2 * 5 * 11^2 are not terms since they are not the products of distinct primes.
Links
- Michael S. Branicky, Table of n, a(n) for n = 1..10000
Programs
-
Maple
test := proc(n) local d; d := convert(n,base,10); return ListTools[Reverse](d)=d and numtheory[mobius](n)=-1 and not isprime(n); end; a := []; for n from 1 to 30000 by 2 do if test(n) then a := [op(a),n]; end; od; a;
-
Mathematica
Select[Range[2,20000], ! PrimeQ[#] && OddQ[#] && PalindromeQ[#] && OddQ[Length[Transpose[FactorInteger[#]][[2]]]] && Max[Transpose[FactorInteger[#]][[2]]] == 1 &] (* Tanya Khovanova, Aug 26 2022 *)
-
Python
from sympy import isprime, factorint from itertools import count, islice, product def cond(n): if n%2 == 0 or isprime(n): return False f = factorint(n) return len(f) == sum(f.values()) and len(f)&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(), 38))) # Michael S. Branicky, Aug 25 2022
Extensions
Edited by Dean Hickerson, Oct 21 2002
Name edited by Tanya Khovanova, Aug 26 2022