A049101 Numbers m such that m divides (product of digits of m) * (sum of digits of m).
1, 2, 3, 4, 5, 6, 7, 8, 9, 15, 18, 24, 45, 48, 135, 144, 288, 378, 476, 756, 864, 1575, 39366, 69984, 139968
Offset: 1
Examples
139968 is in the sequence since it divides (1*3*9*9*6*8) * (1+3+9+9+6+8). - _Giovanni Resta_, Mar 20 2013
Links
- Giovanni Resta, Method used to compute the full sequence
Programs
-
Mathematica
okQ[n_]:=Module[{idn=IntegerDigits[n]},!MemberQ[idn,0] && Divisible[ (Total[idn]*Times@@idn),n]] (* Harvey P. Dale, Jul 16 2011 *) (* full sequence *) dig[nD_] := Block[{ric, sol = {}, check}, check[mu_, minN_] := Block[{di = DigitCount@minN, k = 1, r}, While[(r = mu/k) >= minN, If[IntegerQ[r] && DigitCount[r] == di, AppendTo[sol, r]]; k++]]; ric[n_, prod_, sum_, lastd_, cnt_] := Block[{t}, If[cnt == nD, check[prod*sum, n], Do[t = nD - cnt - 1; If[n*10^(t+1) <= d*prod*9^t*(sum + d + 9*t), ric[10*n + d, d*prod, d + sum, d, cnt + 1], Break[]], {d, 9, lastd, -1}]]]; ric[0, 1, 0, 1, 0]; Print["nDig=", nD, " sol=", sol = Sort@sol]; sol]; Flatten[dig /@ Range[84]] (* Giovanni Resta, Mar 20 2013 *)
Comments