C1. For a positive integer $n$, we define function $P(n)$ to be the sum of the digits of $n$ plus the number of digits of $n$. For example, $P(45)=4+5+2=11$. (Note that the first digit of $n$ reading from left to right, cannot be 0 ).
(a) Determine $P(2017)$.
(b) Determine all numbers $n$ such that $P(n)=4$.
(c) Determine with an explanation whether there exists a number $n$ for which $P(n)-P(n+1)>$ 50 .
Solution: $2+0+1+7+4=14$.
The answer is $\mathrm{P}(2017)=14$.

Solution: Consider 1-digit numbers, then $n=3$. Among 2-digit numbers we need those with the sum of their digits equal to 2 ; so we have $n=11$ and $n=20$. Among 3 -digit numbers we need those with the sum of their digits equal to 1 ; so we have $n=100$. For numbers with 4 or greater than 4 digits, $P(n)>4$, so we have listed all possible numbers with the required property.
The answer is $3,11,20,100$.

Solution: If $n$ and $n+1$ differ only in one last digit the equality $P(n)-P(n+1)>50$ is not possible.
Consider the case when $n$ consisits of $k 9$ 's. Then $P(n)=9 k+k=10 k$ and $P(n+1)=1+(k+1)=k+2$. So we have $P(n)-P(n+1)=9 k-2>50$, so $k \geq 6$. For $k=6$ we obtain $n=999,999$ and $P(999,999)-P(1,000,000)=60-8>50$.
The answer is Yes, for example $n=999,999$.