login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

Composite numbers with only palindromic prime factors.
4

%I #22 May 15 2022 16:24:34

%S 4,6,8,9,10,12,14,15,16,18,20,21,22,24,25,27,28,30,32,33,35,36,40,42,

%T 44,45,48,49,50,54,55,56,60,63,64,66,70,72,75,77,80,81,84,88,90,96,98,

%U 99,100,105,108,110,112,120,121,125,126,128,132,135,140,144,147,150

%N Composite numbers with only palindromic prime factors.

%H Robert Israel, <a href="/A046349/b046349.txt">Table of n, a(n) for n = 1..3020</a>

%F A033620 INTERSECT A002808. - _R. J. Mathar_, Sep 09 2015

%p isA046349 := proc(n)

%p simplify(isA033620(n) and not isprime(n)) ;

%p end proc:

%p for n from 2 to 300 do

%p if isA046349(n) then

%p printf("%d,",n) ;

%p end if;

%p end do: # _R. J. Mathar_, Sep 09 2015

%t palQ[n_]:=Reverse[x=IntegerDigits[n]]==x; Select[Range[4,150],!PrimeQ[#]&&And@@palQ/@First/@FactorInteger[#]&] (* _Jayanta Basu_, Jun 05 2013 *)

%t Select[Range[200],CompositeQ[#]&&AllTrue[FactorInteger[#][[All,1]],PalindromeQ]&] (* _Harvey P. Dale_, May 15 2022 *)

%o (Python)

%o from sympy import isprime, primefactors

%o def pal(n): s = str(n); return s == s[::-1]

%o def ok(n): return not isprime(n) and all(pal(f) for f in primefactors(n))

%o print(list(filter(ok, range(4, 151)))) # _Michael S. Branicky_, Apr 06 2021

%Y Cf. A002385, A033620, A046350, A046351.

%K nonn,base,easy

%O 1,1

%A _Patrick De Geest_, Jun 15 1998