Summing the digits

Let S ( n ) S(n) denote the sum of the digits of an positive integer n n .

Find the smallest positive integer k k such that S ( 18 k ) > 18 S(18k)>18 .


The answer is 111.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

3 solutions

Chew-Seong Cheong
May 25, 2015

Since 18 k 18k is divisible by 9 9 , this means that S ( 18 k ) S(18k) must be a multiple of 9 9 . For the smallest k k such that S ( 18 k m ) > 18 S(18k_{m}) > 18 , means that S ( 18 k m ) = 27 S(18k_{m}) = 27 .

That smallest n n such that S ( n ) = 27 S(n)=27 is n = 999 n = 999 . Since 18 k m 18k_m is even, 18 k m 18k_m must be at least a 4 4 -digit integer. The smallest 4 4 -digit even integer such that S ( n ) = 27 S(n)=27 is n = 1998 n=1998 and since 1998 = 111 × 18 1998= 111\times 18 is divisible by 18 18 , then k m k_m must be 111 \boxed{111} .

Moderator note:

Great approach using the rules of divisibility to set up the conditions which avoids having to slowly search through all positive integers.

sorry i can't understand how u brought S(18k)=27,and can't we just use sum of an n terms of an AP(Arithmetic progresssion) to get it.

kush pandya - 6 years ago

Log in to reply

Digit sum of a multiple of 9 9 must be divisible by 9 9 , therefore digit sum of a multiple of 18 18 must also be divisible by 9 9 . Therefore, S ( 18 k ) S(18k) , which is digit sum of 18 k 18k must be = 9 , 18 , 27 , . . . =9,18,27, ... . As the maximum of digit sum increases with the number of digit. Therefore, the smallest 18 k 18k must have a digit sum of 27 27 , it cannot be any number from 19 19 to 26 26 .

Chew-Seong Cheong - 6 years ago
Brock Brown
May 25, 2015

Python 2.7:

1
2
3
4
5
6
7
8
def S(k):
    return sum([int(i) for i in str(k)])
def goal(k):
    return S(18*k) > 18
k = 0
while not goal(k):
    k += 1
print "Answer:", k

A number with two digits will have maximum sum of the digits as 9+9=18. ..So k must at lest be three digit. Now, for n from 1 to 10, 18 * n the total of digits is 9. While for n=11, 18 * 11=198, and 100 * 18=1800. So (11 +100) * 18=198+1800=1998, sum of digits >18. S o k = 111 \text{A number with two digits will have maximum sum of the digits as} \\ \text {9+9=18. ..So k must at lest be three digit. Now, for n from 1 to 10,} \\ \text{18 * n the total of digits is 9.}\\ \text{While for n=11, 18 * 11=198, and 100 * 18=1800.}\\ \text {So (11 +100) * 18=198+1800=1998, sum of digits >18.}\\So ~ k=~~~~~\Large \color{#D61F06}{111}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...