A046349 Composite numbers with only palindromic prime factors.
4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 27, 28, 30, 32, 33, 35, 36, 40, 42, 44, 45, 48, 49, 50, 54, 55, 56, 60, 63, 64, 66, 70, 72, 75, 77, 80, 81, 84, 88, 90, 96, 98, 99, 100, 105, 108, 110, 112, 120, 121, 125, 126, 128, 132, 135, 140, 144, 147, 150
Offset: 1
Links
- Robert Israel, Table of n, a(n) for n = 1..3020
Programs
-
Maple
isA046349 := proc(n) simplify(isA033620(n) and not isprime(n)) ; end proc: for n from 2 to 300 do if isA046349(n) then printf("%d,",n) ; end if; end do: # R. J. Mathar, Sep 09 2015
-
Mathematica
palQ[n_]:=Reverse[x=IntegerDigits[n]]==x; Select[Range[4,150],!PrimeQ[#]&&And@@palQ/@First/@FactorInteger[#]&] (* Jayanta Basu, Jun 05 2013 *) Select[Range[200],CompositeQ[#]&&AllTrue[FactorInteger[#][[All,1]],PalindromeQ]&] (* Harvey P. Dale, May 15 2022 *)
-
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(4, 151)))) # Michael S. Branicky, Apr 06 2021