Denote by $P(n)$ the product of the digits of a positive integer $n$. For example, $P(1948)=1\cdot9\cdot4\cdot8=288$. Evaluate the sum $P(1)+P(2)+\dots+P(2017)$. Determine the maximum value of $\frac{P(n)}{n}$ where $2017\leq n\leq5777$.
Problem
Source: Israel National Olympiad 2017 Q2
Tags: number theory, Product, Digits, maximize
08.08.2019 04:22
The first problem is not too bad. all you need is to find $S$ as the sum of $P(k)$ where $k$ is from 1 to 99. Then $100-199$, ... $900$ - $999$ comes naturally as $S$ $2S$ ... $9S$. Everything from $1000-1999$ is the same as the sum of $S+2S+...+9S$. 2000 to 2017, $P(k)$'s are all zero.
Attachments:

08.08.2019 04:45
OK, the solution to the second part now makes sense to me as I have the following plot:
Attachments:

08.08.2019 05:52
I am not getting the solutions ,plz explain the solution of first and second question.
01.06.2020 20:38
Chimphechunu wrote: I am not getting the solutions ,plz explain the solution of first and second question. First one is very easy. Second one I can't solve.