login
Numbers that can be written as (m + sum of digits of m + product of digits of m) for some m.
5

%I #33 Dec 19 2022 15:05:18

%S 3,6,9,11,12,14,15,17,18,20,21,22,23,24,26,27,29,30,32,33,34,35,38,42,

%T 43,44,46,48,50,53,54,55,56,58,62,63,66,68,69,73,74,76,77,78,80,82,83,

%U 86,88,90,92,95,97,98,99,101,103,104,105,106,107,108,109,110

%N Numbers that can be written as (m + sum of digits of m + product of digits of m) for some m.

%C Integers that are in A161351.

%C (i) Can arbitrarily long sets of consecutive integers be found in this sequence?

%C (ii) Is the gap between two consecutive terms bounded?

%C A000533 \ {1} is a subsequence.

%C This has the same asymptotic density, approximately 0.9022222, as A176995, since the asymptotic density of non-pandigital numbers is 0. - _Charles R Greathouse IV_, Nov 16 2022

%H David A. Corneth, <a href="/A358350/b358350.txt">Table of n, a(n) for n = 1..10000</a>

%F a(n) ~ kn with k approximately 1.108374, see comments. - _Charles R Greathouse IV_, Nov 16 2022

%e A161351(23) = 23 + (2+3) + (2*3) = 34 so 34 is a term.

%e There is no integer du_10 such that du + (d+u) + (d*u) = 31, so 31 is not a term.

%t f[n_] := n + Total[(d = IntegerDigits[n])] + Times @@ d; With[{m = 110}, Select[Union[Table[f[n], {n, 1, m}]], # <= m &]] (* _Amiram Eldar_, Nov 11 2022 *)

%o (PARI) f(n) = my(d=digits(n)); n + vecsum(d) + vecprod(d); \\ A161351

%o lista(nn) = select(x->(x<=nn), Set(vector(nn, k, f(k)))); \\ _Michel Marcus_, Nov 12 2022

%o (Python)

%o from math import prod

%o def sp(n): d = list(map(int, str(n))); return sum(d) + prod(d)

%o def ok(n): return any(m + sp(m) == n for m in range(n))

%o print([k for k in range(111) if ok(k)]) # _Michael S. Branicky_, Dec 19 2022

%Y Range of A161351.

%Y Similar: A176995 (m+digitsum), A336826 (m*digitprod), A337718 (m+digitprod).

%Y Cf. A000533.

%K nonn,base

%O 1,1

%A _Bernard Schott_, Nov 11 2022