%I #19 Jan 20 2024 09:21:33
%S 2,3,4,5,7,27,378,576,588,648,729,2688,17496,19683,49896,69888,
%T 3796875,3857868,4898880,5878656,7077888,8957952,2499898464,
%U 34998578496,49997969280,2928898896840,7625597484987,184958866998359685
%N Numbers n such that sum of digits of n is equal to the sum of the prime factors of n, counted with multiplicity.
%C a(29) > 10^30. - _Giovanni Resta_, Apr 23 2017
%e 27=3*3*3, 2+7=9, 3+3+3=9. 49896 = 2*2*2*3*3*3*3*7*11, 4+9+8+9+6 = 36, 2+2+2+3+3+3+3+7+11 = 36.
%t g@n_ := Cases[Union@(Times @@ # & /@Select[Flatten[Table[IntegerPartitions[k, All, Prime@Range@PrimePi@(9*n)], {k,1,9*n}],1],Plus@@#==DigitSum@(Times @@ #) &]),
%t _?(#<10^n&)];
%t g@18 (*Requires Mathematica version 14 or later*) (* _Hans Rudolf Widmer_, Jan 20 2024 *)
%o (ARIBAS): var stk: stack; end; for n := 1 to 2000000 do s := itoa(n); for j := 0 to length(s) - 1 do stack_push(stk,atoi(s[j..j])); end; if sum(stack2array(stk)) = sum(factorlist(n)) then write(n," "); end; end;.
%o (PARI) isok(m) = my(f=factor(m)); sumdigits(m) == f[, 1]~*f[, 2]; \\ _Michel Marcus_, Dec 18 2020
%Y Cf. A001414, A007953.
%K nonn,base,more
%O 1,1
%A _Felice Russo_, Aug 13 2001
%E More terms from _Klaus Brockhaus_, Aug 17 2001
%E More terms from _David Wasserman_, Jul 11 2002
|