Product of Sum of Digits

discrete mathematicsrecreational-mathematics

This is a bonus problem my teacher gave us during a competition math class:

Is there a positive integer $n$ such that $S(n)S(n + 4)$ = $2022?$

The $S(n)$ means the sum of digits of $n.$ For example, if $n=14,$ then $S(n)=5$.

I've prime factorized $2022=2 \cdot 3 \cdot 337$ so far. And I've tried having $n=337$ and $n=666,$ both of which ended up fruitless.

I've realized that there needs to be lots of $9$s in the middle of the number to carry into $0$ but so far nothing has worked for me. Can I please have some help? Thanks!

Best Answer

Perhaps the simplest solution comes from trials with the factors of $2022$:

$$S(n)=2022,S(n+4)=1\implies n+4=10^k\\n=10^k-4\implies S(n)=9k-3\\9k-3=2022\implies k=225$$

This gives our first solution: $$n=10^{225}-4$$

Other solutions exist, with $S(n+4)=3$, including Jean-Claude Arbaut's: $$\begin{align}&n=10^{75}-2\\&n=2\times10^{75}-3\\&n=3\times10^{75}-4\end{align}$$ And infinitely many others, such as $n=21\times10^{75}-4$ or $n=111\times10^{75}-4$

Related Question