A062237 Numbers k which are (sum of digits of k) concatenated with (product of digits of k).
0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 119, 1236, 19135, 19144, 261296, 3634992, 43139968
Offset: 1
Examples
1236 has sum of digits 12 and product of digits 36.
Crossrefs
Programs
-
Mathematica
sdpdQ[n_]:=Module[{idn=IntegerDigits[n],s,p},s=Total[idn];p=Times@@idn;n==FromDigits[Join[IntegerDigits[s],IntegerDigits[p]]]]; Select[Range[44*10^6],sdpdQ] (* Harvey P. Dale, Nov 23 2024 *)
-
Python
from math import prod from sympy.utilities.iterables import multiset_permutations as mp from itertools import count, islice, combinations_with_replacement as mc def c(s): d = list(map(int, s)) return sorted(s) == sorted(str(sum(d)) + str(prod(d))) def ok(s): d = list(map(int, s)) return s[0] != '0' and "".join(s) == str(sum(d)) + str(prod(d)) def nd(d): yield from ("".join(m) for m in mc("0123456789", d)) def b(): yield from (s for d in count(1) for s in nd(d) if c(s)) def a(): yield from (int("".join(p)) for s in b() for p in mp(s) if ok(p)) print(list(islice(a(), 16))) # Michael S. Branicky, Jun 30 2022
Extensions
More terms from Harvey P. Dale, Jul 04 2001
More terms from David W. Wilson, Apr 28 2005; he reports on May 03 2005 that there are no further terms.
Offset corrected by Altug Alkan, Apr 10 2018
Comments