login
Palindromes n whose product of proper divisors is a palindrome > 1 and not equal to n.
0

%I #27 Mar 17 2023 15:31:39

%S 4,9,121,212,1001,10201,110011,1100011,10100101,11000011,101000101,

%T 110000011,1010000101,1100000011,10000000001,10100000101,

%U 1000000000001,10000000000001,10011100000111001,10022212521222001,10100101110100101,10101100100110101

%N Palindromes n whose product of proper divisors is a palindrome > 1 and not equal to n.

%C Palindromes in the sequence A229970.

%F A229970 INTERSECT A002113.

%e The product of the proper divisors of 4 is 2 (also a palindrome, different from 4). So, 4 is a member of this sequence.

%e The proper divisors of 1001 are 1, 7, 11, 13, 77, 91, and 143. 1*7*11*13*77*91*143 = 1001^3 = 1003003001 (also a palindrome, different from 1001). So, 1001 is a member of this sequence.

%t palQ[n_] := Block[{d = IntegerDigits@ n}, d == Reverse@ d]; fQ[n_] := Block[{s = Times @@ Most@ Divisors@ n}, And[palQ@ s, s > 1, s != n]]; Select[Select[Range@ 1000000, palQ], fQ] (* _Michael De Vlieger_, Apr 06 2015 *)

%t ppdpQ[n_]:=Module[{pp=Times@@Most[Divisors[n]]},AllTrue[{n,pp},PalindromeQ]&&pp>1&&pp!=n]; Select[Range[115*10^4],ppdpQ] (* The program generates the first 8 terms of the sequence. *) (* _Harvey P. Dale_, Sep 18 2022 *)

%o (Python)

%o from sympy import divisors

%o def PD(n):

%o p = 1

%o for i in divisors(n):

%o if i != n:

%o p *= i

%o return p

%o def pal(n):

%o r = ''

%o for i in str(n):

%o r = i + r

%o return r == str(n)

%o {print(n,end=', ') for n in range(1,10**6) if pal(n) and pal(PD(n)) and (PD(n)-1) and PD(n)-n}

%o # Simplified by _Derek Orr_, Apr 05 2015

%o # Syntax error fixed by _Robert C. Lyons_, Mar 17 2023

%o (PARI) pal(n)=d=digits(n);Vecrev(d)==d

%o for(n=1,10^6,D=divisors(n);p=prod(i=1,#D-1,D[i]);if(pal(n)&&pal(p)&&p-1&&p-n,print1(n,", "))) \\ _Derek Orr_, Apr 05 2015

%Y Cf. A229970, A007956.

%K nonn,base

%O 1,1

%A _Derek Orr_, Oct 04 2013

%E a(7)-a(22) from _Giovanni Resta_, Oct 06 2013

%E Name edited by _Derek Orr_, Apr 05 2015