For every positive integer $n$ let $S(n)$ be the sum of its digits. We say $n$ has a property $P$ if all terms in the infinite secuence $n, S(n), S(S(n)),...$ are even numbers, and we say $n$ has a property $I$ if all terms in this secuence are odd. Show that for, $1 \le n \le 2017$ there are more $n$ that have property $I$ than those who have $P$.
Problem
Source: Iberoamerican 2017 p.1
Tags: number theory, Iberoamerican, international competitions
20.09.2017 20:28
Since the maximum digitsum is $S(1999)=28$, clearly $S^2(n)=S^3(n)=S^4(n)=\dots$ for all $n$ except for $1999$, which we do not care about since it does not have property $I$. Then we can describe the numbers that have property $I$ as all numbers such that $n,S(n),S^2(n)$ are all odd, and numbers that have property $P$ as all numbers such that $n,S(n),S^2(n)$ are all even. Let $k$ be an even number with property $P$. Since $k$ cannot have $9$ in the units digit, we have $S(k+1)=S(k)+1$. Since $S(k)$ cannot have 9 in the units digit, we have $S(S(k)+1)=S(S(k))+1$. Note that $k+1,S(k+1),S(S(k+1))$ are all odd and therefore $k+1$ has property $I$. We have proven that for every even number $k$ that follows property $P$, the number $k+1$ follows property $I$. Since our numbers of interest are $1,\dots,2017$, the largest of which is an odd number, we have proven that there are at least the same amount of numbers with $P$ and numbers with $I$. But notice that the number $1$ has property $I$ and is not part of the numbers $k+1$ with $k$ even and following $P$. Therefore there is at least one more number with $I$ than numbers with $P$, $\blacksquare$.
29.07.2019 15:53
An intuitive way to think about it is the following If n belongs to P then n+1 belongs to I This is because S^a(n+1)=S^a(n)+1 when n belongs to P So we have an injection from P to I, since for every integer in P the next integer is in I. We already know P<=I The key is realizing that 0 is not in the set, hence 1 doesn't have an even counter part. Tipping the scale. Meaning that because we did not include 0 we are sure to have less numbers in the P category
03.10.2021 01:32
Note that $1$ has property $I$ and that $2017$ cannot have property $P$ since it is odd. Claim: If $n$ has property $P$, then $n+1$ has property $I$. Proof. We proceed by strong induction. Our base cases are one digit even numbers, which clearly satisfy the claim. Suppose $n$ has property $P$ and the claim holds for all numbers less than $n$. Then, since $n$ has $P$, so does $S(n)<n$, meaning that $S(n)+1$ has property $I$. However, $n+1$ is odd, so $n+1$ has property $I$ as desired. $\square$ Then, since every integer with property $P$ is paired with some integer with property $I$ and $1$ also has property $I$, there are more with property $I$ than $P$. $\blacksquare$