The problem is as such:
Say a natural number $n$ as special if it does not have the digit $0$, has $2021$ as the sum of its digits, and the sum of the digits of $2n$ does not exceed 1202. Let $N$ be the largest number that is special. How many digits does $N$ have?
I thought to let $N = a_k10^k + a_{k-1}10^{k-1}+\dots+a_210^2+a_110+a_0$. This way, the requirements become:
- $a_i\neq0$ for $i=\{1,2,\dots k\}$.
- $a_1+a_2+\dots\ a_k=2021$ for $1\leq a_1,a_2,\dots,a_k\leq 9$.
- $2a_1+2a_2+\dots+2a_k\leq1202$ for $1\leq a_1,a_2,\dots,a_k\leq 9$.
I have tried to meddle with the second and third using stars and bars, but I met a deadend. Help would be appreciated, thanks.