Let S ( n ) denote the sum of digits of the integer n . Over all positive integers, the minimum and maximum values of S ( 5 n ) S ( n ) are X and Y respectively. The value of X + Y can be written as b a , where a and b are coprime positive integers. What is the value of a + b ?
This problem is proposed by Zi Song .
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.
None of the submitted solutions could justify why the minimum must occur at n = 1 , 1 0 , … , and the maximum must occur at n = 2 , 4 , 6 , 8 , … . Note that the maximum doesn't occur at every even integer. Common mistakes include claiming that to achieve the maximum, we must minimize the denominator, which must then be 1. This is not necessarily true since the value n affects both the numerator and the denominator.
I've chosen to present Zi Song's own solution (and award him the points).
Nice problem! How are you able to come up with such problems?
How s(2) is equal to 2??it should be 1.5
Let n = ∑ k = 1 m a k 1 0 k − 1 where a k is the kth digit of n, 0 ≤ a k ≤ 9 and m is the number of digits. Then S ( n ) = ∑ k = 1 m a k . We write 5 n = ∑ k = 1 m 5 a k 1 0 k − 1 = ∑ k = 1 m ( b k 1 0 k + c k 1 0 k − 1 ) where 5 a k = 1 0 b k + c k . Now we note that c k is either 5 or 0 and 0 ≤ b k ≤ 4 (because 5 × 9 = 4 5 ). So for every k we have c k + 1 + b k < 1 0 which allows us to write: S ( 5 n ) = ∑ k = 1 m S ( 5 a k ) . Lets look at S ( 5 a k ) . If a k is even c k = 0 and 0 ≤ b k ≤ 4 . In general we find that if a k is even S ( 5 a k ) = 2 a k . If a k is odd c k = 5 and 0 ≤ b k ≤ 4 . In general we find that if a k is odd S ( 5 a k ) = 2 a k − 1 + 5 . Let j be the number of even numbered digits of n and without loss of generality we can assume that a 1 , a 2 , a 3 , . . . , a j are even and a j + 1 , a j + 2 , a j + 3 , . . . , a m are odd. Then we have:
S ( 5 n ) S ( n ) = ( S ( 5 a 1 ) + S ( 5 a 2 ) + S ( 5 a 3 ) + . . . + S ( 5 a j ) ) + ( S ( 5 a j + 1 ) + S ( 5 a j + 2 ) + S ( 5 a j + 3 ) + . . . + S ( 5 a m ) S ( n )
= ( 2 a 1 + 2 a 2 + 2 a 3 + . . . + 2 a j ) + ( 2 a j + 1 − 1 + 5 + 2 a j + 2 − 1 + 5 + 2 a j + 3 − 1 + 5 + . . . + 2 a m − 1 + 5 ) S ( n )
= 2 1 ( a 1 + a 2 + a 3 + . . . a j ) + ( 2 a j + 1 + 2 a j + 2 + 2 a j + 3 + . . . + 2 a m + ( 5 − 2 1 ) ( m − j ) ) S ( n )
= 2 1 S ( n ) + 2 9 ( m − j ) S ( n ) = 1 + S ( n ) 9 ( m − j ) 2
To find the maximum value of S ( 5 n ) S ( n ) = 1 + S ( n ) 9 ( m − j ) 2 we try to find the minimum value of S ( n ) 9 ( m − j ) ( 1 ) . The numerator of ( 1 ) is zero when m = j that is when all the digits of n are even. That gives us Y = 1 + S ( n ) 9 ( 0 ) 2 = 2 . To find the minimum value of S ( 5 n ) S ( n ) we try to find the maximum value of ( 1 ) . Maximum value of the numerator in ( 1 ) is when j=0 which tells us that the digits of n are odd. The denominator is the smallest when the sum of n's digits is the smallest, which is when all the digits are 1. That will give S ( n ) = m and therefore X = 1 + m 9 ( m ) 2 = 1 0 2 = 5 1 . If 1 ≤ j ≤ m − 1 then 0 < m − j < m so any mix of even and odd digits will give ( 1 ) a value between X and Y .
This is a very long solution, which really gets to the bottom on the issue. Just to answer the question of the problem, one can use the fact (easily verified by analyzing the multiplication algorithm) that the sum of the digits of the product is less than the product of the sum of the digits of factors.
I think you should also assume WLOG that there are no '0' digits in n. This way you can claim that the smallest possible value of S(n) is m.
That L A T E X is amazing...
Very nice and well explained solution! I struggled with proving one fifth and 2 was the min and max for all n, and shamefully ended up guessing after inspecting the first values of S(n) /S(5n).
Although I found that since n kongruent with S(n) mod 9, we get S(5n) kongruent with 5 S(n) mod 9. So S(5n) = 5 S(n) + 9k(n) where k(n) is an integer depending on n. After some formula manipulation I got that S(n) /S(5n) = 1/5 * 1/(1+9k(n) / (5S(n)) but I failed to find any continuation. Was I way off with this? What could I have done to get further?
In order to find the minimum, we minimize S(n) as much as possible so we plug in n = 1 and 5n = 5, and we get sums of each respectively, 1 and 5 implying that S(n)/S(5n) = 1/5. Using other cases, we found out that for other integers that the maximum value for S(n)/S(5n) is 2 for one-digit integers n = 2, 4, 6, and 8. Evaluating 1/5 + 2 = 1/5 + 10/5 = 11/5. Hence, 11+5 = 16.
But how were we able to get 2 as maximum and 1/5 as minimum? Since for all positive integers ranging, there are infinite positive integers but since we are given a fraction which may have its minimum and maximum. When finding the minimum, we make sure the integers we are choosing are as much as possible minimized. So, hence, the minimum 1/5.
But how about the maximum, we can't maximize the integers, remember that we are dealing with fractions. Also, talking about sum of the digits, there may be possible values for the numerator and denominator, numerator can range from 1 to infinity (ranging for all positive integers), but let's take case by case.
For example, a 3-digit number can have its sum ranging from 1 to 27 and since depending on the numerator, the sum of its digits may differ i.e. all even digits in the numerator must have sum of its digits when multiplied by 5 halved.
This is a common example of "Fallacious proof by a ton of nonsense statements", where a lot is written to give you the impression that they know what they are talking about, when they actually don't. Most of the statements written above are nonsensical, wrong or irrelevant.
What?
Write n = ∑ a i 1 0 i . It's easy to show that (convince yourself of this, it is quite simple!) S ( 5 n ) = S ( ∑ 5 a i 1 0 i ) = ∑ S ( 5 a i 1 0 i ) = ∑ S ( 5 a i ) . For example, 1 8 = S ( 5 ⋅ 1 4 5 8 ) = S ( 5 ⋅ 1 ) + S ( 5 ⋅ 4 ) + S ( 5 ⋅ 5 ) + S ( 5 ⋅ 8 ) = S ( 5 ) + S ( 2 0 ) + S ( 2 5 ) + S ( 4 0 ) = 5 + 2 + 7 + 4 = 1 8 . Now we want the min and max of S ( 5 n ) S ( n ) = ∑ S ( 5 a i ) ∑ S ( a i ) . Remark that min ( S ( 5 a i ) S ( a i ) ) ≤ ∑ S ( 5 a i ) ∑ S ( a i ) ≤ max ( S ( 5 a i ) S ( a i ) ) . It's easy to check that for digits a i , min ( S ( 5 a i ) S ( a i ) ) = 5 1 and max ( S ( 5 a i ) S ( a i ) ) = 2 . Thus 5 1 ≤ ∑ S ( 5 a i ) ∑ S ( a i ) ≤ 2 , and equality is easy to achieve in both cases with a i = 1 , 2 , respectively.
There are two main steps to this problem: Finding the minimum value, and finding the maximum value. Here's how to do both.
Minimum Value -->
Since the problem specifies positive integers, the minmum value of S(n) is 1. When S(n) = 1, then S(n) = 5 - This will also hold when n is 10 or 50, among other values.
So the minimum value, X, is 5 1 .
Maximum Value -->
The maximum value can be obtained with a simple guess-and-check synopsis of the first 9 natural numbers. 1 gives us 0.2; 2 gives us 2. If you look further down the number scale, you'll find that it is impossible to obtain a greater value than 2.
Therefore, the maximum value, Y, is 2.
Putting It All Together...
X + Y = 5 1 + 2 = 5 1 1
So the final answer is 11 + 5, which equals 16 .
This solution commits several common mistakes.
The minimum of g ( x ) f ( x ) does not need to happen when f ( x ) is minimum, or when g ( x ) is maximum.
Checking finitely many values doesn't give you a conclusion about infinitely many values.
Here's the latexed version:
It is well known that S ( a + b ) ≤ S ( a ) + S ( b ) , with equality iff there are no carries in the addition.
Therefore, by Induction, S ( d n ) ≤ d ∗ S ( n ) .
⟹ S ( 5 n ) ≤ 5 ∗ S ( n ) ⟹ S ( 5 n ) S ( n ) ≥ 5 1 .
⟹ 2 S ( 5 n ) ≥ S ( 1 0 n ) = S ( n ) ⟹ S ( 5 n ) S ( n ) ≤ 2 .
It is easy to observe that the equalities really hold. For instance, in the first inequality, n = 1 and in the second n = 2 .
So, X + Y = 2 + 5 1 = 5 1 1 ⟹ a + b = 1 6 .
It is well known that $S(a+b) \le S(a)+S(b)$, with equality iff there are no carries in the addition.
Therefore, by Induction, $S(dn) \le d.S(n)$.
$\implies S(5n) \le 5.S(n) \implies \frac{S(n)}{S(5n)} \ge \frac{1}{5}$.
$\implies 2S(5n) \ge S(10n)=S(n) \implies \frac{S(n)}{S(5n)} \le 2$.
It is easy to observe that the equalities really hold. For instance, in the first inequality, $n=1$ and in the second $n=2$.
So, $X+Y=2+ \frac{1}{5}=\frac{11}{5} \implies a+b=16$.
good solution dude
As everyone else probably did, I started plugging in values and noticing that 5 1 is the minimum and 2 is the maximum value for S ( 5 n ) S ( n ) . Of course, since we're mathematicians, we can't make that claim until we prove it.
What we want to prove is 5 1 ≤ S ( 5 n ) S ( n ) ≤ 2 . Before we go on to the actual proof, let's see what happens when we multiply a number by 5.
Consider a number
n
=
a
1
a
2
a
3
.
.
.
a
k
, where k is the natural number denoting the number of digits of
n
.
Let
5
n
=
b
1
b
2
b
3
.
.
.
b
k
b
k
+
1
, where
b
k
+
1
∈
{
0
,
1
,
2
,
3
,
4
}
.
Notice that the digit
b
0
can be written as
r
0
, where
r
0
=
5
if
a
0
is odd and
r
0
=
0
if
a
0
is even.
For
i
∈
{
1
,
2
,
3
,
.
.
.
,
k
}
,
b
i
can be written as
b
i
=
r
i
+
⌊
a
i
−
1
/
2
⌋
, where, again,
r
i
=
5
if
a
i
is odd and
r
i
=
0
if
a
i
is even. What this actually means is that the i-th position of the number
5
n
is the sum of the number we carried over from the previous position and the last digit of
5
a
i
.
For
i
=
k
+
1
, we have
b
k
+
1
=
⌊
a
k
/
2
⌋
.
Now, let's prove the left side of the inequality, which is equivalent to
i
=
0
∑
k
(
r
i
+
⌊
a
i
/
2
⌋
)
≤
5
i
=
0
∑
k
a
i
. Moving this around, we get
i
=
0
∑
k
r
i
≤
i
=
0
∑
k
(
5
a
i
−
⌊
a
i
/
2
⌋
)
, which holds because for each
i
,
r
i
≤
5
a
i
−
⌊
a
i
/
2
⌋
. If
a
i
is odd, then
r
i
=
5
and we get
5
≤
2
9
a
i
+
1
, which is true for all odd digits, whereas if
a
i
is even,
r
i
=
0
and the inequality is reduced to
2
9
a
i
≥
0
, which is also true for all even digits.
So, the left side of the inequality is proven.
The proof of the right side is similar to the proof of the left, and becomes i = 0 ∑ k r i ≥ i = 0 ∑ k ( a i − 2 ⌊ a i / 2 ⌋ ) . If we compare every r i and its respective a i − 2 ⌊ a i / 2 ⌋ , we get 0 ≥ 0 if a i is even, and 1 0 ≥ 1 if a i is odd.
Great approach of tracking down how multiplication by 5 works. Thanks for recognizing that "since we're mathematicians, we can't make that claim until we prove it."
Pointers for improving your solution:
Each digit d of n contribute in S ( 5 n ) for :
2 d + 0 if d is even
( 2 d − 2 1 ) + 5 if d is odd
(since d ≤ 9 there is no carry).
So S ( 5 n ) = 2 9 o d d ( n ) + 2 1 S ( n ) where o d d ( n ) is the number of odd digits in n
then S ( 5 n ) S ( n ) = 9 S ( n ) o d d ( n ) + 1 2
So
min = 5 1 when all digits are 0 or 1
max = 2 when all digits are even
Conjecture:
That the maximum occurs when all the digits are even or zeroes
That the minimum occurs when all the digits are 1s or zeroes
Proof: 1-->
Consider any number with all digits even. For example, we take 246. Multiplying by 5 means multiplying by 10/2. First, multiplying by 10 (giving 2460) doesn't have any effect on s(n), it only introduces a zero. Second, multiplying by 1/2 halves all the digits ( giving 1230). This halves s(n), and s(n)/s(5n) equals 2. Now consider changing one or more of the digits of 246 with the next odd digit. We change 6 to 7. The 0 gets added as usual, we get 2470 but dividing by 2, we get 1235. And s(n)/s(5n) becomes smaller than 2 (the numerator increased only by one while the denominator increased by 5). Adding one to any digit of an all even digit number involves an addition of 5 to s(5n). This reasoning, though non rigorous, can be applied to all even digited numbers and we see that the maximum must be 2.
2-->
In a similar manner, we take 111 for our example. Multiplying by 10 gives 1110 while dividing by 2 gives 555. The ratio we get is 3/15=1/5. Now, if we change any of the digits, say, the hundreds 1 with 3, to get 311. Multiplying by 10, we get 3110. And dividing by 2, we get 1555. S(n) increases by 2 while s(5n) by only 1. So the ratio increases. Replacement by other digits involves only half of the new digit being added to s(5n), and t hat with the possibility of decreasing s(5n) by 5(in case of replacement with an even digit). Again, this reasoning can be generalised to establish that 1/5 is the minimum.
We have, then, X+Y = 2+1/5=11/5. And a+b= 11+5=16
So by intuition, it should not be hard for one to feel out that the minimum values should be obtained with some superset of n = k ∑ 1 ⋅ 1 0 k and the maximum values are obtained with some superset of n = k ∑ 2 ⋅ 1 0 k . We can get a very rigorous proof of this by considering the well known fact that S ( a b ) ≤ S ( a ) S ( b ) , proven by expansion. We have S ( 5 x ) ≤ 5 S ( x ) for the lower bound and S ( x ) = S ( 1 0 x ) ≤ 2 S ( 5 x ) for the upper bound. At this point, computing 2 + 5 1 should be trivial.
Python 3.4.2
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
Let n = a 1 a 2 a 3 . . . . Then S ( n ) = a 1 + a 2 + a 3 . . . and S ( 5 n ) = S ( 5 a 1 ) + S ( 5 a 2 ) + S ( 5 a 3 ) . . . .
In order to maximize the value of S ( 5 n ) S ( n ) every digit a i must attain the maximum value for S ( a i ) and minimum for S ( 5 a i ) or the opposite for minimizing.
We can easily check for which digits it occurs by simple arithmetic. For convenience let f ( n ) = S ( 5 n ) S ( n ) , we exclude 0 as it doesn't affect neither sum.
We have that:
f ( 1 ) = 5 1 , f ( 2 ) = 2 , f ( 3 ) = 2 1 ,
f ( 4 ) = 2 , f ( 5 ) = 7 5 , f ( 6 ) = 2 ,
f ( 7 ) = 8 7 , f ( 8 ) = 2 , f ( 9 ) = 1 .
From this we can see that the numerator is maximized and denominator minimized when a i = { 0 , 2 , 4 , 6 , 8 } and the opposite when a i = { 0 , 1 } .
Thus Y = 2 (e.g n = 2 0 4 8 ) and X = 5 1 (e.g n = 1 0 0 0 1 1 0 ).
Finally X + Y = 5 1 1 , so a + b = 1 6 .
For minimum value take n as 1.It comes as 1/5 For maximum value take n as 2.It comes as 2 2+1/5 =11/5 Therfore a+b=16
The maximum value of the expression s(n)/s(5 n) is 2 which comes when n=2,4,6....that is at even numbers. The minimum value of this expression is 1/5 which comes for n=1,5 and so on. so x=1/5 and y=2. Hence x+y will be 11/5 (11 and 5 are coprime positive integers) Hence a=11 and b=5 and so a+b will be 16
minimum is when s(5n)=5*s(n) so minimum is 1/5 = 0.2 maximum is when the number that occurs after 5n gives a digit sum of 1 so any such number like 2 ,10 will do maximum value = 2 x+y=2+.2=2.2 x+y=11/5 = 16
The value of S(n) and S(5n) are calculated for different values of n and it is found that the ratio S(n)/S(5n) attains minimum in case of n=1 on considering the ratio for odd digits i.e 1,3,5,7 and maximum in case of all the single digit even numbers and the maximum value is two for n=2,4,6,8 and for n=9 the ratio is 1.Using all the odd digits sequentially for n i.e n=1357 the ratio is 8/13 which is far more than the ratio obtained for n=1. Similarly using all the even digits sequentially for n i.e for n=2468 the ratio is 2. Thus the sum of minimum and maximum value is given by 1/5+2=(1+10)/5=11/5. Value of a=11 and b=5 and a+b=16.
The minimum value 'X' can be got by using n=1,which gives (1/5). The maximum value 'Y' can be got by using various values for n which includes all even numbers , which gives 2. X+Y=(1/5)+2=(1/5)+(10/5)=11/5 Therefore the answer is 11+5=16.
To get X minimum of s(n)/s(5n) we want minimum s(n) which is 1 for n=1 & 10 & 100 & 1000 etc Here s(5n)=5 So X minimum of s(n)/s(5n) will be 1/5
To get Y maximum of s(n)/s(5n) we want minimum s(5n) which is 1 for n=2 & 20 & 200 & 2000 etc Here s(n)=2 So Y maximum of s(n)/s(5n) will be 2/1
So adding X and Y we get 1/5+2/1 = (1+10)/5*1 Final answer is 16
Note that the proof is incomplete as I have not proved 2 statements (1) minimum numerator gives minimum X and (2) minimum denominator gives maximum Y
Problem Loading...
Note Loading...
Set Loading...
Claim: For integers a , b , we have S ( a b ) ≤ S ( a ) S ( b ) .
This can be shown by considering the digit expansion. Let a = ∑ a i 1 0 i , b = ∑ b i 1 0 i , then a b = ∑ i [ ∑ 0 ≤ k ≤ i a k b i − k 1 0 i ] . As such, S ( a b ) ≤ ∑ i [ ∑ 0 ≤ k ≤ i a k b i − k ] = S ( a ) S ( b ) .
Claim: S ( 1 0 x ) = S ( x ) .
This is obvious, since 1 0 x is just x with a 0 appended to the end.
Thus, S ( 5 x ) ≤ S ( 5 ) S ( x ) = 5 S ( x ) , so S ( 5 x ) S ( x ) ≥ 5 1 . Equality holds when x = 1 (and possibly other cases), so we have X = 5 1 .
Also, S ( x ) = S ( 1 0 x ) ≤ S ( 2 ) S ( 5 x ) = 2 S ( 5 x ) , thus S ( 5 x ) S ( x ) ≤ 2 . Equality holds when x = 2 (and possibly other cases), so Y = 2 .
Thus, X + Y = 5 1 1 , so a + b = 1 1 + 5 = 1 6 .