A066282
Numbers k such that k = (product of nonzero digits of k) * (sum of digits of k).
Original entry on oeis.org
0, 1, 135, 144, 1088
Offset: 1
(1+0+8+8) * (1*8*8) = 17*64 = 1088, so 1088 belongs to the sequence.
-
function a066282(a,b: integer); var n,k,j,p,d: integer; s: string; begin for n := a to b do s := itoa(n); k := 0; p := 1; for j := 0 to length(s) - 1 do d := atoi(s[j..j]); k := k + d; if d > 0 then p := p*d; end; end; if n = p*k then write(n,","); end; end; end; a066282(0,25000).
-
Do[ d = Sort[ IntegerDigits[n]]; While[ First[d] == 0, d = Drop[d, 1]]; If[n == Apply[ Plus, d] Apply[ Times, d], Print[n]], {n, 0, 5*10^7} ]
-
a066282(a,b) = local(n,k,q,p,d); for(n=a,b,k=0; p=1; q=n; while(q>0,d=divrem(q,10); q=d[1]; k=k+d[2]; p=p*max(1,d[2])); if(n==p*k,print1(n,", ")))
a066282(0,25000)
A366832
Numbers k such that k = (product of nonzero digits) * (sum of digits) for the digits of k in base 9.
Original entry on oeis.org
1, 12, 1536, 172032, 430080, 4014080
Offset: 1
430080 = 724856_9, (7+2+4+8+5+6)*(7*2*4*8*5*6) = 32*13440 = 430080.
-
Select[Range[5*10^6],Total[IntegerDigits[#,9]]*Fold[Times,1,IntegerDigits[#,9]]==#&] (* James C. McMahon, Jan 30 2024 *)
-
isok(k, b) = my(d=select(x->(x>0), digits(k,b))); vecprod(d)*vecsum(d) == k;
for (k=1, 10^7, if (isok(k, 9), print1(k, ", ")))
A367070
Numbers k such that k = (product of nonzero digits) * (sum of digits) for the digits of k in base 7.
Original entry on oeis.org
1, 16, 128, 250, 480, 864, 21600, 62208, 73728
Offset: 1
21600 = 116655_7, (1+1+6+6+5+5)*(1*1*6*6*5*5) = 24*900 = 21600.
-
Select[Range[7^7], #1 == Times @@ DeleteCases[#2, 0]*Total[#2] & @@ {#, IntegerDigits[#, 7]} &] (* Michael De Vlieger, Mar 25 2024 *)
-
isok(k, b) = my(d=select(x->(x>0), digits(k,b))); vecprod(d)*vecsum(d) == k;
for (k=1, 10^5, if (isok(k, 7), print1(k, ", ")))
A370251
Base-12 numbers k such that k = (product of nonzero digits of k) * (sum of digits of k) (written in base 10).
Original entry on oeis.org
1, 176, 231, 495, 7040
Offset: 1
231 = 173_12, (1*7*3)*(1+7+3) = 21*11 = 231.
-
Select[Range[5*10^4], Total[IntegerDigits[#, 12]]*Fold[Times, 1, Select[IntegerDigits[#, 12],#>0&]]==#&] (* James C. McMahon, Feb 14 2024 *)
-
isok(k, b) = my(d=select(x->(x>0), digits(k, b))); vecprod(d)*vecsum(d) == k;
for (k=0, 10^10, if (isok(k, 12), print1(k, ", ")))
Showing 1-4 of 4 results.
Comments