+0

# more modular arithmetic argghhh

0
106
7
+200

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}?$$

Jun 26, 2019

#1
+200
0

help plz??

Jun 27, 2019
#2
+23066
+3

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}$$ ?

$$\begin{array}{|c|r|r|r|r|r|} \hline & n & S(n) & S(S(n)) & n+S(n)+S(S(n)) & n+S(n)+S(S(n)) \pmod{ 9} \\ \hline 1 & 106 & 5671 & 16082956 & 16088733 & 0 \\ 2 & 108 & 5886 & 17325441 & 17331435 & 0 \\ 3 & 115 & 6670 & 22247785 & 22254570 & 0 \\ 4 & 117 & 6903 & 23829156 & 23836176 & 0 \\ 5 & 124 & 7750 & 30035125 & 30042999 & 0 \\ 6 & 126 & 8001 & 32012001 & 32020128 & 0 \\ 7 & 133 & 8911 & 39707416 & 39716460 & 0 \\ 8 & 135 & 9180 & 42140790 & 42150105 & 0 \\ 9 & 142 & 10153 & 51546781 & 51557076 & 0 \\ 10 & 144 & 10440 & 54502020 & 54512604 & 0 \\ 11 & 151 & 11476 & 65855026 & 65866653 & 0 \\ 12 & 153 & 11781 & 69401871 & 69413805 & 0 \\ 13 & 160 & 12880 & 82953640 & 82966680 & 0 \\ 14 & 162 & 13203 & 87166206 & 87179571 & 0 \\ 15 & 169 & 14365 & 103183795 & 103198329 & 0 \\ 16 & 171 & 14706 & 108140571 & 108155448 & 0 \\ 17 & 178 & 15931 & 126906346 & 126922455 & 0 \\ 18 & 180 & 16290 & 132690195 & 132706665 & 0 \\ 19 & 187 & 17578 & 154501831 & 154519596 & 0 \\ 20 & 189 & 17955 & 161199990 & 161218134 & 0 \\ 21 & 196 & 19306 & 186370471 & 186389973 & 0 \\ 22 & 198 & 19701 & 194074551 & 194094450 & 0 \\ 23 & 205 & 21115 & 222932170 & 222953490 & 0 \\ 24 & 207 & 21528 & 231738156 & 231759891 & 0 \\ 25 & 214 & 23005 & 264626515 & 264649734 & 0 \\ 26 & 216 & 23436 & 274634766 & 274658418 & 0 \\ 27 & 223 & 24976 & 311912776 & 311937975 & 0 \\ 28 & 225 & 25425 & 323228025 & 323253675 & 0 \\ 29 & 232 & 27028 & 365269906 & 365297166 & 0 \\ 30 & 234 & 27495 & 378001260 & 378028989 & 0 \\ 31 & 241 & 29161 & 425196541 & 425225943 & 0 \\ 32 & 243 & 29646 & 439457481 & 439487370 & 0 \\ 33 & 250 & 31375 & 492211000 & 492242625 & 0 \\ 34 & 252 & 31878 & 508119381 & 508151511 & 0 \\ 35 & 259 & 33670 & 566851285 & 566885214 & 0 \\ 36 & 261 & 34191 & 584529336 & 584563788 & 0 \\ 37 & 268 & 36046 & 649675081 & 649711395 & 0 \\ 38 & 270 & 36585 & 669249405 & 669286260 & 0 \\ 39 & 277 & 38503 & 741259756 & 741298536 & 0 \\ 40 & 279 & 39060 & 762861330 & 762900669 & 0 \\ 41 & 286 & 41041 & 842202361 & 842243688 & 0 \\ 42 & 288 & 41616 & 865966536 & 866008440 & 0 \\ 43 & 295 & 43660 & 953119630 & 953163585 & 0 \\ 44 & 297 & 44253 & 979186131 & 979230681 & 0 \\ 45 & 304 & 46360 & 1074647980 & 1074694644 & 0 \\ 46 & 306 & 46971 & 1103160906 & 1103208183 & 0 \\ 47 & 313 & 49141 & 1207443511 & 1207492965 & 0 \\ 48 & 315 & 49770 & 1238551335 & 1238601420 & 0 \\ 49 & 322 & 52003 & 1352182006 & 1352234331 & 0 \\ 50 & 324 & 52650 & 1386037575 & 1386090549 & 0 \\ 51 & 331 & 54946 & 1509558931 & 1509614208 & 0 \\ 52 & 333 & 55611 & 1546319466 & 1546375410 & 0 \\ 53 & 340 & 57970 & 1680289435 & 1680347745 & 0 \\ 54 & 342 & 58653 & 1720116531 & 1720175526 & 0 \\ 55 & 349 & 61075 & 1865108350 & 1865169774 & 0 \\ 56 & 351 & 61776 & 1908167976 & 1908230103 & 0 \\ 57 & 358 & 64261 & 2064770191 & 2064834810 & 0 \\ 58 & 360 & 64980 & 2111232690 & 2111298030 & 0 \\ 59 & 367 & 67528 & 2280049156 & 2280117051 & 0 \\ 60 & 369 & 68265 & 2330089245 & 2330157879 & 0 \\ 61 & 376 & 70876 & 2511739126 & 2511810378 & 0 \\ 62 & 378 & 71631 & 2565535896 & 2565607905 & 0 \\ 63 & 385 & 74305 & 2760653665 & 2760728355 & 0 \\ 64 & 387 & 75078 & 2818390581 & 2818466046 & 0 \\ 65 & 394 & 77815 & 3027626020 & 3027704229 & 0 \\ 66 & 396 & 78606 & 3089490921 & 3089569923 & 0 \\ 67 & 403 & 81406 & 3313509121 & 3313590930 & 0 \\ 68 & 405 & 82215 & 3379694220 & 3379776840 & 0 \\ 69 & 412 & 85078 & 3619175581 & 3619261071 & 0 \\ 70 & 414 & 85905 & 3689877465 & 3689963784 & 0 \\ 71 & 421 & 88831 & 3945517696 & 3945606948 & 0 \\ 72 & 423 & 89676 & 4020937326 & 4021027425 & 0 \\ 73 & 430 & 92665 & 4293447445 & 4293540540 & 0 \\ 74 & 432 & 93528 & 4373790156 & 4373884116 & 0 \\ 75 & 439 & 96580 & 4663896490 & 4663993509 & 0 \\ 76 & 441 & 97461 & 4749371991 & 4749469893 & 0 \\ 77 & 448 & 100576 & 5057816176 & 5057917200 & 0 \\ 78 & 450 & 101475 & 5148638550 & 5148740475 & 0 \\ 79 & 457 & 104653 & 5476177531 & 5476282641 & 0 \\ 80 & 459 & 105570 & 5572565235 & 5572671264 & 0 \\ 81 & 466 & 108811 & 5919971266 & 5920080543 & 0 \\ 82 & 468 & 109746 & 6022147131 & 6022257345 & 0 \\ 83 & 475 & 113050 & 6390207775 & 6390321300 & 0 \\ 84 & 477 & 114003 & 6498399006 & 6498513486 & 0 \\ 85 & 484 & 117370 & 6887917135 & 6888034989 & 0 \\ 86 & 486 & 118341 & 7002355311 & 7002474138 & 0 \\ 87 & 493 & 121771 & 7414149106 & 7414271370 & 0 \\ 88 & 495 & 122760 & 7535070180 & 7535193435 & 0 \\ 89 & 502 & 126253 & 7969973131 & 7970099886 & 0 \\ 90 & 504 & 127260 & 8097617430 & 8097745194 & 0 \\ 91 & 511 & 130816 & 8556478336 & 8556609663 & 0 \\ 92 & 513 & 131841 & 8691090561 & 8691222915 & 0 \\ 93 & 520 & 135460 & 9174773530 & 9174909510 & 0 \\ 94 & 522 & 136503 & 9316602756 & 9316739781 & 0 \\ 95 & 529 & 140185 & 9825987205 & 9826127919 & 0 \\ 96 & 531 & 141246 & 9975286881 & 9975428658 & 0 \\ 97 & 538 & 144991 & 10511267536 & 10511413065 & 0 \\ 98 & 540 & 146070 & 10668295485 & 10668442095 & 0 \\ 99 & 547 & 149878 & 11231782381 & 11231932806 & 0 \\ 100 & 549 & 150975 & 11396800800 & 11396952324 & 0 \\ \hline \end{array}$$

$$\begin{array}{|c|r|r|r|r|r|} \hline & n & S(n) & S(S(n)) & n+S(n)+S(S(n)) & n+S(n)+S(S(n)) \pmod{ 9} \\ \hline 101 & 556 & 154846 & 11988719281 & 11988874683 & 0 \\ 102 & 558 & 155961 & 12161994741 & 12162151260 & 0 \\ 103 & 565 & 159895 & 12783285460 & 12783445920 & 0 \\ 104 & 567 & 161028 & 12965088906 & 12965250501 & 0 \\ 105 & 574 & 165025 & 13616707825 & 13616873424 & 0 \\ 106 & 576 & 166176 & 13807314576 & 13807481328 & 0 \\ 107 & 583 & 170236 & 14490232966 & 14490403785 & 0 \\ 108 & 585 & 171405 & 14689922715 & 14690094705 & 0 \\ 109 & 592 & 175528 & 15405127156 & 15405303276 & 0 \\ 110 & 594 & 176715 & 15614183970 & 15614361279 & 0 \\ 111 & 601 & 180901 & 16362676351 & 16362857853 & 0 \\ 112 & 603 & 182106 & 16581388671 & 16581571380 & 0 \\ 113 & 610 & 186355 & 17364186190 & 17364373155 & 0 \\ 114 & 612 & 187578 & 17592846831 & 17593035021 & 0 \\ 115 & 619 & 191890 & 18410981995 & 18411174504 & 0 \\ 116 & 621 & 193131 & 18649888146 & 18650081898 & 0 \\ 117 & 628 & 197506 & 19504408771 & 19504606905 & 0 \\ 118 & 630 & 198765 & 19753861995 & 19754061390 & 0 \\ 119 & 637 & 203203 & 20645831206 & 20646035046 & 0 \\ 120 & 639 & 204480 & 20906137440 & 20906342559 & 0 \\ 121 & 646 & 208981 & 21836633671 & 21836843298 & 0 \\ 122 & 648 & 210276 & 22108103226 & 22108314150 & 0 \\ 123 & 655 & 214840 & 23078220220 & 23078435715 & 0 \\ 124 & 657 & 216153 & 23361167781 & 23361384591 & 0 \\ 125 & 664 & 220780 & 24372014590 & 24372236034 & 0 \\ 126 & 666 & 222111 & 24666759216 & 24666981993 & 0 \\ 127 & 673 & 226801 & 25719460201 & 25719687675 & 0 \\ 128 & 675 & 228150 & 26026325325 & 26026554150 & 0 \\ 129 & 682 & 232903 & 27122020156 & 27122253741 & 0 \\ 130 & 684 & 234270 & 27441333585 & 27441568539 & 0 \\ 131 & 691 & 239086 & 28581177241 & 28581417018 & 0 \\ 132 & 693 & 240471 & 28913271156 & 28913512320 & 0 \\ 133 & 700 & 245350 & 30098433925 & 30098679975 & 0 \\ 134 & 702 & 246753 & 30443644881 & 30443892336 & 0 \\ 135 & 709 & 251695 & 31675312360 & 31675564764 & 0 \\ 136 & 711 & 253116 & 32033981286 & 32034235113 & 0 \\ 137 & 718 & 258121 & 33313354381 & 33313613220 & 0 \\ 138 & 720 & 259560 & 33685826580 & 33686086860 & 0 \\ 139 & 727 & 264628 & 35014121506 & 35014386861 & 0 \\ 140 & 729 & 266085 & 35400746655 & 35401013469 & 0 \\ 141 & 736 & 271216 & 36779194936 & 36779466888 & 0 \\ 142 & 738 & 272691 & 37180327086 & 37180600515 & 0 \\ 143 & 745 & 277885 & 38610175555 & 38610454185 & 0 \\ 144 & 747 & 279378 & 39026173131 & 39026453256 & 0 \\ 145 & 754 & 284635 & 40508683930 & 40508969319 & 0 \\ 146 & 756 & 286146 & 40939909731 & 40940196633 & 0 \\ 147 & 763 & 291466 & 42476360311 & 42476652540 & 0 \\ 148 & 765 & 292995 & 42923181510 & 42923475270 & 0 \\ 149 & 772 & 298378 & 44514864631 & 44515163781 & 0 \\ 150 & 774 & 299925 & 44977652775 & 44977953474 & 0 \\ 151 & 781 & 305371 & 46625876506 & 46626182658 & 0 \\ 152 & 783 & 306936 & 47105007516 & 47105315235 & 0 \\ 153 & 790 & 312445 & 48811095235 & 48811408470 & 0 \\ 154 & 792 & 314028 & 49306949406 & 49307264226 & 0 \\ 155 & 799 & 319600 & 51072239800 & 51072560199 & 0 \\ 156 & 801 & 321201 & 51585201801 & 51585523803 & 0 \\ 157 & 808 & 326836 & 53411048866 & 53411376510 & 0 \\ 158 & 810 & 328455 & 53941507740 & 53941837005 & 0 \\ 159 & 817 & 334153 & 55829280781 & 55829615751 & 0 \\ 160 & 819 & 335790 & 56377629945 & 56377966554 & 0 \\ 161 & 826 & 341551 & 58328713576 & 58329055953 & 0 \\ 162 & 828 & 343206 & 58895350821 & 58895694855 & 0 \\ 163 & 835 & 349030 & 60911144965 & 60911494830 & 0 \\ 164 & 837 & 350703 & 61496472456 & 61496823996 & 0 \\ 165 & 844 & 356590 & 63578392345 & 63578749779 & 0 \\ 166 & 846 & 358281 & 64182816621 & 64183175748 & 0 \\ 167 & 853 & 364231 & 66332292796 & 66332657880 & 0 \\ 168 & 855 & 365940 & 66956224770 & 66956591565 & 0 \\ 169 & 862 & 371953 & 69174703081 & 69175075896 & 0 \\ 170 & 864 & 373680 & 69818558040 & 69818932584 & 0 \\ 171 & 871 & 379756 & 72107499646 & 72107880273 & 0 \\ 172 & 873 & 381501 & 72771697251 & 72772079625 & 0 \\ 173 & 880 & 387640 & 75132578620 & 75132967140 & 0 \\ 174 & 882 & 389403 & 75817542906 & 75817933191 & 0 \\ 175 & 889 & 395605 & 78251855815 & 78252252309 & 0 \\ 176 & 891 & 397386 & 78958015191 & 78958413468 & 0 \\ 177 & 898 & 403651 & 81467266726 & 81467671275 & 0 \\ 178 & 900 & 405450 & 82195053975 & 82195460325 & 0 \\ 179 & 907 & 411778 & 84780766531 & 84781179216 & 0 \\ 180 & 909 & 413595 & 85530618810 & 85531033314 & 0 \\ 181 & 916 & 419986 & 88194330091 & 88194750993 & 0 \\ 182 & 918 & 421821 & 88966688931 & 88967111670 & 0 \\ 183 & 925 & 428275 & 91709951950 & 91710381150 & 0 \\ 184 & 927 & 430128 & 92505263256 & 92505694311 & 0 \\ 185 & 934 & 436645 & 95329646335 & 95330083914 & 0 \\ 186 & 936 & 438516 & 96148360386 & 96148799838 & 0 \\ 187 & 943 & 445096 & 99055447156 & 99055893195 & 0 \\ 188 & 945 & 446985 & 99898018605 & 99898466535 & 0 \\ 189 & 952 & 453628 & 102889408006 & 102889862586 & 0 \\ 190 & 954 & 455535 & 103756295880 & 103756752369 & 0 \\ \hline \end{array}$$

$$\begin{array}{|c|r|r|r|r|r|} \hline & n & S(n) & S(S(n)) & n+S(n)+S(S(n)) & n+S(n)+S(S(n)) \pmod{ 9} \\ \hline 191 & 961 & 462241 & 106833602161 & 106834065363 & 0 \\ 192 & 963 & 464166 & 107725269861 & 107725734990 & 0 \\ 193 & 970 & 470935 & 110890122580 & 110890594485 & 0 \\ 194 & 972 & 472878 & 111807037881 & 111807511731 & 0 \\ 195 & 979 & 479710 & 115061081905 & 115061562594 & 0 \\ 196 & 981 & 481671 & 116003716956 & 116004199608 & 0 \\ 197 & 988 & 488566 & 119348612461 & 119349102015 & 0 \\ 198 & 990 & 490545 & 120317443785 & 120317935320 & 0 \\ 199 & 997 & 497503 & 123754866256 & 123755364756 & 0 \\ 200 & 999 & 499500 & 124750374750 & 124750875249 & 0 \\ \hline \end{array}$$

Jun 27, 2019
#3
+23066
+1

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}$$?

Second interpretation

$$\begin{array}{|c|r|r|r|r|r|} \hline & n & S(n) & S(S(n)) & n+S(n)+S(S(n)) & n+S(n)+S(S(n)) \pmod{ 9} \\ \hline 1 & 102 & 3 & 3 & 108 & 0 \\ 2 & 105 & 6 & 6 & 117 & 0 \\ 3 & 108 & 9 & 9 & 126 & 0 \\ 4 & 111 & 3 & 3 & 117 & 0 \\ 5 & 114 & 6 & 6 & 126 & 0 \\ 6 & 117 & 9 & 9 & 135 & 0 \\ 7 & 120 & 3 & 3 & 126 & 0 \\ 8 & 123 & 6 & 6 & 135 & 0 \\ 9 & 126 & 9 & 9 & 144 & 0 \\ 10 & 129 & 12 & 3 & 144 & 0 \\ 11 & 132 & 6 & 6 & 144 & 0 \\ 12 & 135 & 9 & 9 & 153 & 0 \\ 13 & 138 & 12 & 3 & 153 & 0 \\ 14 & 141 & 6 & 6 & 153 & 0 \\ 15 & 144 & 9 & 9 & 162 & 0 \\ 16 & 147 & 12 & 3 & 162 & 0 \\ 17 & 150 & 6 & 6 & 162 & 0 \\ 18 & 153 & 9 & 9 & 171 & 0 \\ 19 & 156 & 12 & 3 & 171 & 0 \\ 20 & 159 & 15 & 6 & 180 & 0 \\ 21 & 162 & 9 & 9 & 180 & 0 \\ 22 & 165 & 12 & 3 & 180 & 0 \\ 23 & 168 & 15 & 6 & 189 & 0 \\ 24 & 171 & 9 & 9 & 189 & 0 \\ 25 & 174 & 12 & 3 & 189 & 0 \\ 26 & 177 & 15 & 6 & 198 & 0 \\ 27 & 180 & 9 & 9 & 198 & 0 \\ 28 & 183 & 12 & 3 & 198 & 0 \\ 29 & 186 & 15 & 6 & 207 & 0 \\ 30 & 189 & 18 & 9 & 216 & 0 \\ 31 & 192 & 12 & 3 & 207 & 0 \\ 32 & 195 & 15 & 6 & 216 & 0 \\ 33 & 198 & 18 & 9 & 225 & 0 \\ 34 & 201 & 3 & 3 & 207 & 0 \\ 35 & 204 & 6 & 6 & 216 & 0 \\ 36 & 207 & 9 & 9 & 225 & 0 \\ 37 & 210 & 3 & 3 & 216 & 0 \\ 38 & 213 & 6 & 6 & 225 & 0 \\ 39 & 216 & 9 & 9 & 234 & 0 \\ 40 & 219 & 12 & 3 & 234 & 0 \\ 41 & 222 & 6 & 6 & 234 & 0 \\ 42 & 225 & 9 & 9 & 243 & 0 \\ 43 & 228 & 12 & 3 & 243 & 0 \\ 44 & 231 & 6 & 6 & 243 & 0 \\ 45 & 234 & 9 & 9 & 252 & 0 \\ 46 & 237 & 12 & 3 & 252 & 0 \\ 47 & 240 & 6 & 6 & 252 & 0 \\ 48 & 243 & 9 & 9 & 261 & 0 \\ 49 & 246 & 12 & 3 & 261 & 0 \\ 50 & 249 & 15 & 6 & 270 & 0 \\ 51 & 252 & 9 & 9 & 270 & 0 \\ 52 & 255 & 12 & 3 & 270 & 0 \\ 53 & 258 & 15 & 6 & 279 & 0 \\ 54 & 261 & 9 & 9 & 279 & 0 \\ 55 & 264 & 12 & 3 & 279 & 0 \\ 56 & 267 & 15 & 6 & 288 & 0 \\ 57 & 270 & 9 & 9 & 288 & 0 \\ 58 & 273 & 12 & 3 & 288 & 0 \\ 59 & 276 & 15 & 6 & 297 & 0 \\ 60 & 279 & 18 & 9 & 306 & 0 \\ 61 & 282 & 12 & 3 & 297 & 0 \\ 62 & 285 & 15 & 6 & 306 & 0 \\ 63 & 288 & 18 & 9 & 315 & 0 \\ 64 & 291 & 12 & 3 & 306 & 0 \\ 65 & 294 & 15 & 6 & 315 & 0 \\ 66 & 297 & 18 & 9 & 324 & 0 \\ 67 & 300 & 3 & 3 & 306 & 0 \\ 68 & 303 & 6 & 6 & 315 & 0 \\ 69 & 306 & 9 & 9 & 324 & 0 \\ 70 & 309 & 12 & 3 & 324 & 0 \\ 71 & 312 & 6 & 6 & 324 & 0 \\ 72 & 315 & 9 & 9 & 333 & 0 \\ 73 & 318 & 12 & 3 & 333 & 0 \\ 74 & 321 & 6 & 6 & 333 & 0 \\ 75 & 324 & 9 & 9 & 342 & 0 \\ 76 & 327 & 12 & 3 & 342 & 0 \\ 77 & 330 & 6 & 6 & 342 & 0 \\ 78 & 333 & 9 & 9 & 351 & 0 \\ 79 & 336 & 12 & 3 & 351 & 0 \\ 80 & 339 & 15 & 6 & 360 & 0 \\ 81 & 342 & 9 & 9 & 360 & 0 \\ 82 & 345 & 12 & 3 & 360 & 0 \\ 83 & 348 & 15 & 6 & 369 & 0 \\ 84 & 351 & 9 & 9 & 369 & 0 \\ 85 & 354 & 12 & 3 & 369 & 0 \\ 86 & 357 & 15 & 6 & 378 & 0 \\ 87 & 360 & 9 & 9 & 378 & 0 \\ 88 & 363 & 12 & 3 & 378 & 0 \\ 89 & 366 & 15 & 6 & 387 & 0 \\ 90 & 369 & 18 & 9 & 396 & 0 \\ 91 & 372 & 12 & 3 & 387 & 0 \\ 92 & 375 & 15 & 6 & 396 & 0 \\ 93 & 378 & 18 & 9 & 405 & 0 \\ 94 & 381 & 12 & 3 & 396 & 0 \\ 95 & 384 & 15 & 6 & 405 & 0 \\ 96 & 387 & 18 & 9 & 414 & 0 \\ 97 & 390 & 12 & 3 & 405 & 0 \\ 98 & 393 & 15 & 6 & 414 & 0 \\ 99 & 396 & 18 & 9 & 423 & 0 \\ 100 & 399 & 21 & 3 & 423 & 0 \\ \hline \end{array}$$

$$\begin{array}{|c|r|r|r|r|r|} \hline & n & S(n) & S(S(n)) & n+S(n)+S(S(n)) & n+S(n)+S(S(n)) \pmod{ 9} \\ \hline 101 & 402 & 6 & 6 & 414 & 0 \\ 102 & 405 & 9 & 9 & 423 & 0 \\ 103 & 408 & 12 & 3 & 423 & 0 \\ 104 & 411 & 6 & 6 & 423 & 0 \\ 105 & 414 & 9 & 9 & 432 & 0 \\ 106 & 417 & 12 & 3 & 432 & 0 \\ 107 & 420 & 6 & 6 & 432 & 0 \\ 108 & 423 & 9 & 9 & 441 & 0 \\ 109 & 426 & 12 & 3 & 441 & 0 \\ 110 & 429 & 15 & 6 & 450 & 0 \\ 111 & 432 & 9 & 9 & 450 & 0 \\ 112 & 435 & 12 & 3 & 450 & 0 \\ 113 & 438 & 15 & 6 & 459 & 0 \\ 114 & 441 & 9 & 9 & 459 & 0 \\ 115 & 444 & 12 & 3 & 459 & 0 \\ 116 & 447 & 15 & 6 & 468 & 0 \\ 117 & 450 & 9 & 9 & 468 & 0 \\ 118 & 453 & 12 & 3 & 468 & 0 \\ 119 & 456 & 15 & 6 & 477 & 0 \\ 120 & 459 & 18 & 9 & 486 & 0 \\ 121 & 462 & 12 & 3 & 477 & 0 \\ 122 & 465 & 15 & 6 & 486 & 0 \\ 123 & 468 & 18 & 9 & 495 & 0 \\ 124 & 471 & 12 & 3 & 486 & 0 \\ 125 & 474 & 15 & 6 & 495 & 0 \\ 126 & 477 & 18 & 9 & 504 & 0 \\ 127 & 480 & 12 & 3 & 495 & 0 \\ 128 & 483 & 15 & 6 & 504 & 0 \\ 129 & 486 & 18 & 9 & 513 & 0 \\ 130 & 489 & 21 & 3 & 513 & 0 \\ 131 & 492 & 15 & 6 & 513 & 0 \\ 132 & 495 & 18 & 9 & 522 & 0 \\ 133 & 498 & 21 & 3 & 522 & 0 \\ 134 & 501 & 6 & 6 & 513 & 0 \\ 135 & 504 & 9 & 9 & 522 & 0 \\ 136 & 507 & 12 & 3 & 522 & 0 \\ 137 & 510 & 6 & 6 & 522 & 0 \\ 138 & 513 & 9 & 9 & 531 & 0 \\ 139 & 516 & 12 & 3 & 531 & 0 \\ 140 & 519 & 15 & 6 & 540 & 0 \\ 141 & 522 & 9 & 9 & 540 & 0 \\ 142 & 525 & 12 & 3 & 540 & 0 \\ 143 & 528 & 15 & 6 & 549 & 0 \\ 144 & 531 & 9 & 9 & 549 & 0 \\ 145 & 534 & 12 & 3 & 549 & 0 \\ 146 & 537 & 15 & 6 & 558 & 0 \\ 147 & 540 & 9 & 9 & 558 & 0 \\ 148 & 543 & 12 & 3 & 558 & 0 \\ 149 & 546 & 15 & 6 & 567 & 0 \\ 150 & 549 & 18 & 9 & 576 & 0 \\ 151 & 552 & 12 & 3 & 567 & 0 \\ 152 & 555 & 15 & 6 & 576 & 0 \\ 153 & 558 & 18 & 9 & 585 & 0 \\ 154 & 561 & 12 & 3 & 576 & 0 \\ 155 & 564 & 15 & 6 & 585 & 0 \\ 156 & 567 & 18 & 9 & 594 & 0 \\ 157 & 570 & 12 & 3 & 585 & 0 \\ 158 & 573 & 15 & 6 & 594 & 0 \\ 159 & 576 & 18 & 9 & 603 & 0 \\ 160 & 579 & 21 & 3 & 603 & 0 \\ 161 & 582 & 15 & 6 & 603 & 0 \\ 162 & 585 & 18 & 9 & 612 & 0 \\ 163 & 588 & 21 & 3 & 612 & 0 \\ 164 & 591 & 15 & 6 & 612 & 0 \\ 165 & 594 & 18 & 9 & 621 & 0 \\ 166 & 597 & 21 & 3 & 621 & 0 \\ 167 & 600 & 6 & 6 & 612 & 0 \\ 168 & 603 & 9 & 9 & 621 & 0 \\ 169 & 606 & 12 & 3 & 621 & 0 \\ 170 & 609 & 15 & 6 & 630 & 0 \\ 171 & 612 & 9 & 9 & 630 & 0 \\ 172 & 615 & 12 & 3 & 630 & 0 \\ 173 & 618 & 15 & 6 & 639 & 0 \\ 174 & 621 & 9 & 9 & 639 & 0 \\ 175 & 624 & 12 & 3 & 639 & 0 \\ 176 & 627 & 15 & 6 & 648 & 0 \\ 177 & 630 & 9 & 9 & 648 & 0 \\ 178 & 633 & 12 & 3 & 648 & 0 \\ 179 & 636 & 15 & 6 & 657 & 0 \\ 180 & 639 & 18 & 9 & 666 & 0 \\ 181 & 642 & 12 & 3 & 657 & 0 \\ 182 & 645 & 15 & 6 & 666 & 0 \\ 183 & 648 & 18 & 9 & 675 & 0 \\ 184 & 651 & 12 & 3 & 666 & 0 \\ 185 & 654 & 15 & 6 & 675 & 0 \\ 186 & 657 & 18 & 9 & 684 & 0 \\ 187 & 660 & 12 & 3 & 675 & 0 \\ 188 & 663 & 15 & 6 & 684 & 0 \\ 189 & 666 & 18 & 9 & 693 & 0 \\ 190 & 669 & 21 & 3 & 693 & 0 \\ 191 & 672 & 15 & 6 & 693 & 0 \\ 192 & 675 & 18 & 9 & 702 & 0 \\ 193 & 678 & 21 & 3 & 702 & 0 \\ 194 & 681 & 15 & 6 & 702 & 0 \\ 195 & 684 & 18 & 9 & 711 & 0 \\ 196 & 687 & 21 & 3 & 711 & 0 \\ 197 & 690 & 15 & 6 & 711 & 0 \\ 198 & 693 & 18 & 9 & 720 & 0 \\ 199 & 696 & 21 & 3 & 720 & 0 \\ 200 & 699 & 24 & 6 & 729 & 0 \\ \hline \end{array}$$

$$\begin{array}{|c|r|r|r|r|r|} \hline & n & S(n) & S(S(n)) & n+S(n)+S(S(n)) & n+S(n)+S(S(n)) \pmod{ 9} \\ \hline 201 & 702 & 9 & 9 & 720 & 0 \\ 202 & 705 & 12 & 3 & 720 & 0 \\ 203 & 708 & 15 & 6 & 729 & 0 \\ 204 & 711 & 9 & 9 & 729 & 0 \\ 205 & 714 & 12 & 3 & 729 & 0 \\ 206 & 717 & 15 & 6 & 738 & 0 \\ 207 & 720 & 9 & 9 & 738 & 0 \\ 208 & 723 & 12 & 3 & 738 & 0 \\ 209 & 726 & 15 & 6 & 747 & 0 \\ 210 & 729 & 18 & 9 & 756 & 0 \\ 211 & 732 & 12 & 3 & 747 & 0 \\ 212 & 735 & 15 & 6 & 756 & 0 \\ 213 & 738 & 18 & 9 & 765 & 0 \\ 214 & 741 & 12 & 3 & 756 & 0 \\ 215 & 744 & 15 & 6 & 765 & 0 \\ 216 & 747 & 18 & 9 & 774 & 0 \\ 217 & 750 & 12 & 3 & 765 & 0 \\ 218 & 753 & 15 & 6 & 774 & 0 \\ 219 & 756 & 18 & 9 & 783 & 0 \\ 220 & 759 & 21 & 3 & 783 & 0 \\ 221 & 762 & 15 & 6 & 783 & 0 \\ 222 & 765 & 18 & 9 & 792 & 0 \\ 223 & 768 & 21 & 3 & 792 & 0 \\ 224 & 771 & 15 & 6 & 792 & 0 \\ 225 & 774 & 18 & 9 & 801 & 0 \\ 226 & 777 & 21 & 3 & 801 & 0 \\ 227 & 780 & 15 & 6 & 801 & 0 \\ 228 & 783 & 18 & 9 & 810 & 0 \\ 229 & 786 & 21 & 3 & 810 & 0 \\ 230 & 789 & 24 & 6 & 819 & 0 \\ 231 & 792 & 18 & 9 & 819 & 0 \\ 232 & 795 & 21 & 3 & 819 & 0 \\ 233 & 798 & 24 & 6 & 828 & 0 \\ 234 & 801 & 9 & 9 & 819 & 0 \\ 235 & 804 & 12 & 3 & 819 & 0 \\ 236 & 807 & 15 & 6 & 828 & 0 \\ 237 & 810 & 9 & 9 & 828 & 0 \\ 238 & 813 & 12 & 3 & 828 & 0 \\ 239 & 816 & 15 & 6 & 837 & 0 \\ 240 & 819 & 18 & 9 & 846 & 0 \\ 241 & 822 & 12 & 3 & 837 & 0 \\ 242 & 825 & 15 & 6 & 846 & 0 \\ 243 & 828 & 18 & 9 & 855 & 0 \\ 244 & 831 & 12 & 3 & 846 & 0 \\ 245 & 834 & 15 & 6 & 855 & 0 \\ 246 & 837 & 18 & 9 & 864 & 0 \\ 247 & 840 & 12 & 3 & 855 & 0 \\ 248 & 843 & 15 & 6 & 864 & 0 \\ 249 & 846 & 18 & 9 & 873 & 0 \\ 250 & 849 & 21 & 3 & 873 & 0 \\ 251 & 852 & 15 & 6 & 873 & 0 \\ 252 & 855 & 18 & 9 & 882 & 0 \\ 253 & 858 & 21 & 3 & 882 & 0 \\ 254 & 861 & 15 & 6 & 882 & 0 \\ 255 & 864 & 18 & 9 & 891 & 0 \\ 256 & 867 & 21 & 3 & 891 & 0 \\ 257 & 870 & 15 & 6 & 891 & 0 \\ 258 & 873 & 18 & 9 & 900 & 0 \\ 259 & 876 & 21 & 3 & 900 & 0 \\ 260 & 879 & 24 & 6 & 909 & 0 \\ 261 & 882 & 18 & 9 & 909 & 0 \\ 262 & 885 & 21 & 3 & 909 & 0 \\ 263 & 888 & 24 & 6 & 918 & 0 \\ 264 & 891 & 18 & 9 & 918 & 0 \\ 265 & 894 & 21 & 3 & 918 & 0 \\ 266 & 897 & 24 & 6 & 927 & 0 \\ 267 & 900 & 9 & 9 & 918 & 0 \\ 268 & 903 & 12 & 3 & 918 & 0 \\ 269 & 906 & 15 & 6 & 927 & 0 \\ 270 & 909 & 18 & 9 & 936 & 0 \\ 271 & 912 & 12 & 3 & 927 & 0 \\ 272 & 915 & 15 & 6 & 936 & 0 \\ 273 & 918 & 18 & 9 & 945 & 0 \\ 274 & 921 & 12 & 3 & 936 & 0 \\ 275 & 924 & 15 & 6 & 945 & 0 \\ 276 & 927 & 18 & 9 & 954 & 0 \\ 277 & 930 & 12 & 3 & 945 & 0 \\ 278 & 933 & 15 & 6 & 954 & 0 \\ 279 & 936 & 18 & 9 & 963 & 0 \\ 280 & 939 & 21 & 3 & 963 & 0 \\ 281 & 942 & 15 & 6 & 963 & 0 \\ 282 & 945 & 18 & 9 & 972 & 0 \\ 283 & 948 & 21 & 3 & 972 & 0 \\ 284 & 951 & 15 & 6 & 972 & 0 \\ 285 & 954 & 18 & 9 & 981 & 0 \\ 286 & 957 & 21 & 3 & 981 & 0 \\ 287 & 960 & 15 & 6 & 981 & 0 \\ 288 & 963 & 18 & 9 & 990 & 0 \\ 289 & 966 & 21 & 3 & 990 & 0 \\ 290 & 969 & 24 & 6 & 999 & 0 \\ 291 & 972 & 18 & 9 & 999 & 0 \\ 292 & 975 & 21 & 3 & 999 & 0 \\ 293 & 978 & 24 & 6 & 1008 & 0 \\ 294 & 981 & 18 & 9 & 1008 & 0 \\ 295 & 984 & 21 & 3 & 1008 & 0 \\ 296 & 987 & 24 & 6 & 1017 & 0 \\ 297 & 990 & 18 & 9 & 1017 & 0 \\ 298 & 993 & 21 & 3 & 1017 & 0 \\ 299 & 996 & 24 & 6 & 1026 & 0 \\ 300 & 999 & 27 & 9 & 1035 & 0 \\ \hline \end{array}$$

Jun 27, 2019
#4
+200
+2

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}?$$

Thanks heureka!!

This is the solution given

Any positive integer n is congruent, modulo 9, to the sum of its digits. So, we know that $$S(n)\equiv n\pmod{9}$$ and that $$S(S(n))\equiv S(n)\equiv n\pmod{9}$$. Therefore, we seek n such that $$n+S(n)+S(S(n))\equiv 3n \pmod{9}\equiv 0\pmod{9}$$. This happens when $$n\equiv 0,3, \text{or } 6 \pmod{9}$$, so every third integer works. There are 900 three-digit numbers, so $$900/3=\boxed {300}$$ of them satisfy our congruence.

sudsw12  Jun 27, 2019
edited by Melody  Jun 30, 2019
#5
+103689
0

Thanks Heueka and Sudsw12

I was looking for a shortcut but I didn't quite get there :)

HOW do you know this

Any positive integer n is congruent, modulo 9, to the sum of its digits.  I have not seen that before.

I know that if the sum of the digits is 0 mod 9 then n will also be 0 mod 9.   I think that is reasonably common knowledge.

But

To I have not seen that extend to any sum of digits before.

I wonder how difficult that is to prove.  I have not tried yet.

Jun 28, 2019
edited by Melody  Jun 28, 2019
#6
+200
+1

Hi melody,

according to a number theory paper I found online, they explain this,

". Every positive integer is congruent modulo 9 to the sum of its decimal digits,
because 10 ≡ 1 (mod 9), from which we get 10k ≡ 1 for every positive integer k, and so, for
example, 831 = 8 · 102 + 3 · 10 + 1 ≡ 8 + 3 + 1 = 12. Repeating the trick until we’re left with
just one digit, we conclude 831 ≡ 3 (mod 9). Thus you can quickly check for errors in the
calculation 831 · 42 = 34902 by repeating it modulo 9: If the result is correct you should also
have 3·6 ≡ 3+4+9+0+2 ≡ 0, which is indeed the case. (This does not, of course, prove that
there is no mistake. On average, this procedure ought to catch eight out of nine mistakes.)"

sudsw12  Jun 29, 2019
#7
+103689
0

Thanks Sudsw12,

I will examine what you have said in detail when I have a little more time.

Thanks for answering and  doing this research for me.

It is much appreciated.

Melody  Jun 30, 2019