How to get smallest positive integer N?

Logic Level 3

Define S ( n ) S(n) as the sum of the digits of n n . Let N N denote the smallest positive integer such that N + S ( N ) + S ( S ( N ) ) = 99 N + S(N) + S(S(N)) = 99 . What is S ( N ) S(N) ?


The answer is 15.

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.

2 solutions

Paul Ryan Longhas
Feb 22, 2015

Let T ( N ) = N + S ( N ) + S ( S ( N ) ) T(N) = N + S(N) + S(S(N)) . Since neither S ( N ) S(N) nor S ( S ( N ) ) S(S(N)) can be zero, we must have N 97 N ≤ 97 . Thus S ( N ) 17 S(N) ≤ 17 (using N = 89 N = 89 ) and S ( S ( N ) ) 9 S(S(N)) ≤ 9 . This gives a crude lower bound for N N of 99 ( 17 + 9 ) = 73 99-(17 + 9) = 73 . If S ( N + 1 ) S(N +1) has the same number of digits as S ( N ) S(N) , then T ( N + 1 ) = T ( N ) + 3 T(N +1) = T(N)+3 since S ( N + 1 ) S(N + 1) will be one more than S ( N ) S(N) and S ( S ( N + 1 ) ) S(S(N + 1)) will be one more than S ( N ) S(N) . Moreover, as long as S ( N + k ) S(N + k) continues to have the same number of digits as S ( N ) S(N) , we have T ( N + k ) = T ( N ) + 3 k T(N + k)= T(N) + 3k . The first integer M M greater than 73 73 such that S ( M ) S(M) has only one digit is M = 80 M = 80 . Thus the formula will work from 73 73 up to 79 79 , so for 1 k 6 1 ≤ k ≤ 6 . We have T ( 73 ) = 73 + S ( 73 ) + S ( S ( 73 ) ) = 73 + 10 + 1 = 84 T(73) = 73 + S(73) + S(S(73)) = 73 + 10 + 1 = 84 , and 99 84 = 15 = 3 5 99 - 84 = 15 = 3 · 5 . Thus 99 = T ( 73 ) + 3 5 = T ( 78 ) 99 = T(73) + 3 · 5 = T(78) . Therefore N = 78 N = 78 is the smallest integer with T ( N ) = 99 T(N) = 99 .

By the way it is also possible with N = 84 N=84

Vaibhav Prasad - 6 years, 2 months ago

Log in to reply

N=81 works too

Joel Tan - 6 years, 2 months ago

Log in to reply

Both N= 81,84 but they are not smaller than N=78

Praful Jain - 5 years, 6 months ago

I know it's a strange solution but... It's just how I solved it:

Case 1:

S ( N ) S(N) is a one-digit integer. Then, we have that N = 99 2 S ( N ) N = 99 - 2S(N) (Because in this assumption we know that as S ( N ) S(N) has one digit, S ( S ( N ) ) = S ( N ) S(S(N)) = S(N) . If we check for S ( N ) S(N) in the range 1 S ( N ) 9 1 \leq S(N) \leq 9 , we will get eventually the solution N = 81 N = 81 .

Case 2:

S ( N ) S(N) is a two-digit integer. In this case, we note various things. First, N < 100 N < 100 in order to comply the equation given. Second, as N < 100 N < 100 , the highest value S ( N ) S(N) could take is 18 18 , and this tells us that S ( S ( N ) ) S(S(N)) will be a one digit number. Then, let's express our N N as a b \overline{ab} , and let's express S ( S ( N ) ) S(S(N)) as some one-digit integer c c . We know that a b = 10 a + b \overline{ab} = 10a + b . Also, S ( N ) S(N) will simply be a + b a + b , and S ( S ( N ) ) = c S(S(N)) = c . Our equation is:

11 a + 2 b + c = 99 11a + 2b + c = 99 .

With some mental testing we can see that this equation requires N N to be at least bigger than 70 70 . This is why I set a = 7 a = 7 . The equation turns to be:

2 b + c = 22 2b + c = 22 .

Here it's much easier, as we just have to test 7 b 9 7 \leq b \leq 9 (otherwise, we would make c c be a two-digit integer). We get the following three triplets ( N , S ( N ) , S ( S ( N ) ) ) (N, S(N), S(S(N))) :

( 77 , 14 , 5 ) , ( 78 , 15 , 6 ) , ( 79 , 16 , 7 ) (77, 14, 5), (78, 15, 6), (79, 16, 7) .

Recall that after all S ( S ( N ) ) = c S(S(N)) = c . So here the only solution that isn't contradicting this equation (and that satisfies the original equation of the problem) is the second triplet. Hence, the answer is

S ( N ) = 15 S(N) = \boxed{15} .

Obviously I'm open to any comment! :)

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...