Page 1 of 1

BdMO National 2021 Primary Problem 5

Posted: Mon Apr 12, 2021 9:43 pm
by Anindya Biswas
কোনো ধনাত্মক পূর্ণসংখ্যা $n$-এর জন্য $g(n)$ দিয়ে আমরা তার অঙ্কগুলোর যোগফলকে বোঝাই। কোনো ধনাত্মক পূর্ণসংখ্যা $x$-এর জন্য $g(x),g(g(x)),g(g(g(x))),\cdots$ সিকোয়েন্সেরটার কথা চিন্তা করো। একসময় এই সিকোয়েন্সের পদগুলো আর পরিবর্তিত হবে না। সেই অবস্থায় সিকোয়েন্সের পদগুলো যে সংখ্যাটার সমান হবে, সেটার নাম দাও $f(x)$। কতগুলো ধনাত্মক পূর্ণসংখ্যা $a\leq2021$ আছে যেন $f(a)=9$ হয়?

For a positive integer $n$, let $g(n)$ be the sum of its digits. For a positive integer $x$, consider the sequence $g(x),g(g(x)),g(g(g(x))),\cdots$. At some point, this sequence will eventually be a constant. Denote that constant by $f(x)$. Find the number of positive integers $a\leq2021$ such that $f(a)=9$.

Re: BdMO National 2021 Primary Problem 5

Posted: Fri May 14, 2021 11:46 pm
by Anindya Biswas
In decimal system, we can write a number $n$ as \[n=a_0+a_1\cdot10+a_2\cdot10^2+\cdots+a_k\cdot10^k\] where $a_0,a_1,a_2,\cdots a_k\in\{0,1,2,\cdots,9\}$ and $a_k\neq0$.
Then
\[
\begin{equation}
\begin{split}
g(n)&=a_0+a_1+a_2+\cdots+a_k \\
\therefore n-g(n)&=(10^0-1)a_0+(10^1-1)a_1+(10^2-1)a_2+\cdots+(10^k-1)a_k\\
\Longrightarrow n-g(n)&\equiv0\pmod{9}\\
\Longrightarrow n&\equiv g(n)\pmod{9}\\
\Longrightarrow n&\equiv f(x)\pmod{9}
\end{split}
\end{equation}
\]
$\therefore f(a)=9$ iff $a\equiv0\pmod{9}$ where $a$ is a positive integer.
Number of such integers, \[\boxed{\lfloor\frac{2021}{9}\rfloor=224}\]