OFFSET
1,26
MATHEMATICA
f[n_] := n + Total[(d = IntegerDigits[n])] + Times @@ d; With[{m = 100}, BinCounts[Table[f[n], {n, 1, m}], {1, m, 1}]] (* Amiram Eldar, Nov 16 2022 *)
PROG
(PARI) first(n) = {my(res = vector(n)); for(i = 1, n, c = i + sumdigits(i) + vecprod(digits(i)); if(c <= n, res[c]++ ) ); res } \\ David A. Corneth, Nov 16 2022
(Python)
from itertools import combinations_with_replacement
from math import prod
def A358351(n):
c = set()
for l in range(1, len(str(n))+1):
l1, l2 = 10**l, 10**(l-1)
for d in combinations_with_replacement(tuple(range(10)), l):
s, p = sum(d), prod(d)
if l1>(m:=n-s-p)>=l2 and sorted(int(d) for d in str(m)) == list(d):
c.add(m)
return len(c) # Chai Wah Wu, Nov 20 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Nov 16 2022
STATUS
approved