For each positive integer $n$, let $S(n)$ be the sum of the digits of $n$. Determines the smallest positive integer $a$ such that there are infinite positive integers $n$ for which you have $S (n) -S (n + a) = 2018$.
Problem
Source: Lusophon 2018 CPLP P3
Tags: number theory, sum of digits, minimum
13.09.2018 18:54
Since $S(x)\equiv x \pmod 9$ for all $x$, we get $a\equiv 7 \pmod 9$ from the equation. So especially we have $a \geq 7$. Let $a=7$ and $n = 10^m + 10^{225} - 1$. Then we can verify that $n$ satisfy the equation for all $m\geq 225$. Answer: $a = 7$
17.07.2021 03:00
$Lemma: S(n)\equiv n$ mod $9$ $Proof: n = 10^xa_{1}+10^{x-1}a_{2}+...+ 10a_{x-1} + a{x} \\= 9^xa_{1}+a_{1}+9^{x-1}a_{2}+a_{2}+...+9a_{x-1}+ a_{x-1} + a_{x}\\ \equiv a_{1} + a_{2} +...+ a_{x-1} + a_{x}$ mod $9$, with $1 \leq a_{i} \leq 9$, proving our lemma. $S(n)-S(n + a) \equiv 2018$ mod $9$ $\Leftrightarrow n-n-a \equiv -a \equiv 2$ mod $9$ $\Leftrightarrow a \equiv 7$ mod $9$ The smallest positive integer possible for $a \equiv 7$ mod $9$ is $a=7$, so if $a=7$ satisfy the conditions, it will be the answer. Let $n = 1\underbrace{000\cdots0}_{k} \underbrace{99\dots9}_{225}$, for any $1 \leq k$ with $ k \in Z,$ i.e. $n = 10^{k+225} + 10^{226} -1$. $\Rightarrow n+a = n+7 = 1\underbrace{000\cdots0}_{k-1} 1\underbrace{000\dots0}_{224}6,$ i.e.$n = 10^{k+225} + 10^{256} + 6$ $S(n) = 1+ 225 \cdot9 = 226$ and $S(n+a) = 8 \Rightarrow S(n) - S(n-a)= 2018$. Once we have infinity many k that satisfies the condition $ k \in Z,$ we have infinitely many n that satisfies the condition $S(n)-S(n+7) = 2018 \Rightarrow a =7$