login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A062237 Positive numbers k which are (sum of digits of k) concatenated with (product of digits of k). 7

%I #28 Feb 19 2024 10:32:03

%S 10,20,30,40,50,60,70,80,90,119,1236,19135,19144,261296,3634992,

%T 43139968

%N Positive numbers k which are (sum of digits of k) concatenated with (product of digits of k).

%C For a d-digit number with d >= 88, the sum and product of the digits together have fewer than d digits. So every element of this sequence has 87 or fewer digits, hence it is finite. - _David W. Wilson_, Apr 28 2005

%e 1236 has sum of digits 12 and product of digits 36.

%o (Python)

%o from math import prod

%o from sympy.utilities.iterables import multiset_permutations as mp

%o from itertools import count, islice, combinations_with_replacement as mc

%o def c(s):

%o d = list(map(int, s))

%o return sorted(s) == sorted(str(sum(d)) + str(prod(d)))

%o def ok(s):

%o d = list(map(int, s))

%o return s[0] != '0' and "".join(s) == str(sum(d)) + str(prod(d))

%o def nd(d): yield from ("".join(m) for m in mc("0123456789", d))

%o def b(): yield from (s for d in count(1) for s in nd(d) if c(s))

%o def a(): yield from (int("".join(p)) for s in b() for p in mp(s) if ok(p))

%o print(list(islice(a(), 16))) # _Michael S. Branicky_, Jun 30 2022

%Y Cf. A038364, A038369, A066282.

%K nonn,base,fini,full

%O 1,1

%A _Erich Friedman_, Jun 30 2001

%E More terms from _Harvey P. Dale_, Jul 04 2001

%E More terms from _David W. Wilson_, Apr 28 2005; he reports on May 03 2005 that there are no further terms.

%E Offset corrected by _Altug Alkan_, Apr 10 2018

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 16:56 EDT 2024. Contains 371962 sequences. (Running on oeis4.)