Number Theory question - divisibility

Let s be the smallest positive integer with the property that its digit sum and the digit sum of s + 1 are both divisible by 19. How many digits does s have?

I've tried to find the smallest number, and I got 14 digits(the number 18999999999999), but I was wrong. How come there is a smaller number?

• In your case the digit sum of $s+1$ is 10. Aug 23, 2020 at 1:46

The digit sum of $$s + 1$$ for your number $$18999999999999$$ is $$10$$, not divisible by $$19$$.
If there are $$k$$ $$9$$'s at the end of $$s$$, then the digit sum of $$s$$ and $$s + 1$$ differ by $$9k - 1$$.
Therefore there should be at least $$17$$ $$9$$'s at the end of $$s$$ (as $$17$$ is the inverse of $$9$$ modulo $$19$$). In order for the sum to be divisible by $$19$$, we should add another $$18$$. But it is not possible to do that in two digits, as that would require another two $$9$$'s.
So we must have at least $$20$$ digits, and the smallest such $$s$$ is $$19899999999999999999$$.
• It’s better to emphasize that $s$ must have $9$(s) at its end. Otherwise, the digital sum of $s$ and $s+1$ differ by $1$ and are co - prime Aug 23, 2020 at 1:58
• @RezhaAdrianTanuharja It is in fact implied by the requirement that $9k - 1$ is divisible by $19$. This excludes $k = 0$. Aug 23, 2020 at 1:59