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!)
A358351 Number of values of m such that m + (sum of digits of m) + (product of digits of m) is n. 3
0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 2, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 3, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 2, 0, 0, 1, 1, 1, 1, 0, 2, 0, 0, 0, 2, 1, 0, 0, 1, 0, 2, 1, 0, 0, 0, 1, 2, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 2, 0 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,26
COMMENTS
a(n) is the number of times n occurs in A161351.
a(n) > 0 iff n is in A358350.
LINKS
EXAMPLE
A161351(15) = 15 + (1+5) + (1*5) = 26 = 21 + (2+1) + (2*1) = A161351(21), so, a(26) = 2.
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
Similar: A230093 (m+digitsum), A230103 (m+digitprod).
Sequence in context: A337939 A319020 A099200 * A093578 A172398 A070107
KEYWORD
nonn,base
AUTHOR
Bernard Schott, Nov 16 2022
STATUS
approved

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 23 15:20 EDT 2024. Contains 371916 sequences. (Running on oeis4.)