For each positive integer n, let \(S(n)\) denote the sum of the digits of n. How many three-digit n's are there such that \(n+S(n)+S(S(n))\equiv 0 \pmod{9}? \)
189 198 279 288 297 369 378 387 396 459 468 477 486 495 549 558 567 576 585 594 639 648 657 666 675 684 693 729 738 747 756 765 774 783 792 819 828 837 846 855 864 873 882 891 909 918 927 936 945 954 963 972 981 990 999 Total = 55 such integers.
Example: 189 + S(1+8+9) =18 + S(S(1+8)=9)=189 + 18 +9 = 216 mod 9 = 0
What about 111?
111+3+3=117 = 0 (mod9)
I came up with the digtts must add to one of the following
3,6,9,12,15,18,21,24,27
The smallest is 111
the biggest is 999
and there are lots in between.
111
114
117
120
123
126
129
...
just keep adding 3
so there will be (999-111)/3 +1 = 297 of them
That is what I get anyway.
Maybe you can find one of mine that does not work. I certainly have not checked them.