login
Semiprimes such that sum of digits equals product of digits.
2

%I #35 Feb 15 2018 08:14:04

%S 4,6,9,22,123,213,321,1142,1214,1241,4121,11215,11521,12115,12151,

%T 21151,22121,51211,111261,112611,116121,116211,121161,162111,211611,

%U 261111,621111,1111217,1111413,1111431,1111721,1112117,1117121,1117211,1121117,1121171,1121711

%N Semiprimes such that sum of digits equals product of digits.

%C Intersection of A001358 and A034710.

%C 9 is the only member with digit 9. No member has more than one digit 3 or 6. - _Robert Israel_, May 06 2016

%H Chai Wah Wu, <a href="/A272436/b272436.txt">Table of n, a(n) for n = 1..17009</a> (n = 1..3104 from Robert Israel)

%e 1142 appears in the list because 1142 = 2*571 that is semiprime. Also, 1+1+4+2 = 8 = 1*1*4*2.

%e 11215 appears in the list because 1142 = 5*2243 that is semiprime. Also, 1+1+2+1+5 = 10 = 1*1*2*1*5.

%p R:= proc(k,d,u,v) option remember;

%p if k = 1 then

%p if d = v - u then {[d]}

%p else {}

%p fi

%p else

%p `union`(seq(map(t -> [op(t),s], procname(k-1,d-s,u+s*k,v*k^s)),s=0..d))

%p fi

%p end proc:

%p A034710:= proc(d)

%p local res, r, i, t;

%p res:= NULL;

%p for r in R(9,d,0,1) do

%p res:= res, op(map(t -> add(10^(i-1)*t[i],i=1..nops(t)), combinat:-permute([seq(i$r[i],i=1..9)])));

%p od:

%p sort([res]);

%p end proc:

%p map(op, [seq(select(t -> numtheory:-bigomega(t)=2, A034710(i)),i=1..11)]); # _Robert Israel_, May 06 2016

%t Select[Range[10000000], (Plus @@ IntegerDigits[#]) == (Times @@ IntegerDigits[#]) && PrimeOmega[#] == 2 &]

%Y Cf. A001358, A034710, A066306, A066307.

%K nonn,base

%O 1,1

%A _K. D. Bajpai_, May 06 2016