When all nonnegative integers (so 0 is included) less than 2 5 2 0 1 8 are written down in base 2 5 , what will be the average of all their digit sums?
Other parts
Note:
The digit sum of a number is the sum of all its digits. For example, the digit sum of 2018 is 2 + 0 + 1 + 8 = 1 1 .
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.
let's make all numbers less than 2 5 2 0 1 8 2018 (base-25) digits long (which does not affect the digit sum). Then we see that on each digit position 0~24 appear exactly the same number of times. The average of 0~24 is 12, so the average digit sum is 2 0 1 8 × 1 2 = 2 4 2 1 6 .
From 0 0 . . . 0 ( 2 5 ) to ( 2 4 ) ( 2 4 ) . . . ( 2 4 ) ( 2 5 ) ,
We can make
2
2
5
2
0
1
8
−
1
pairs :
(
(
a
1
)
(
a
2
)
.
.
.
(
a
2
0
1
8
)
,
(
2
4
−
a
1
)
(
2
4
−
a
2
)
.
.
.
(
2
4
−
a
2
0
1
8
)
)
and the averages of this pair are same ( = 2 2 4 ∗ 2 0 1 8 )
And then, only one number( = (12)(12)...(12) ) is center of them, and the sum of this digit is 2 2 4 ∗ 2 0 1 8 , so this doesn't affect average .
So we can know the (Ans) is 2 2 4 ∗ 2 0 1 8
Let's try to find a pattern by first considering numbers in base 2:
decimal | 0 1 0 | 1 1 0 | 2 1 0 | 3 1 0 | 4 1 0 | 5 1 0 | 6 1 0 | 7 1 0 | 8 1 0 | 9 1 0 | 1 0 1 0 | 1 1 1 0 | 1 2 1 0 | 1 3 1 0 | 1 4 1 0 | 1 5 1 0 | … |
binary | 0 2 | 1 2 | 1 0 2 | 1 1 2 | 1 0 0 2 | 1 0 1 2 | 1 1 0 2 | 1 1 1 2 | 1 0 0 0 2 | 1 0 0 1 2 | 1 0 1 0 2 | 1 0 1 1 2 | 1 1 0 0 2 | 1 1 0 1 2 | 1 1 1 0 2 | 1 1 1 1 2 | … |
digit sum | 0 | 1 | 1 | 2 | 1 | 2 | 2 | 3 | 1 | 2 | 2 | 3 | 2 | 3 | 3 | 4 | … |
The average digit sums of all integers less than 2 n , denoted by ∅ 2 ( n ) can now be calculated:
n | 0 | 1 | 2 | 3 | 4 | 5 | … |
∅ 2 ( n ) | 0 | 2 1 | 1 | 2 3 | 2 | 2 5 | … |
It looks like, ∅ 2 ( n ) = 2 1 n . But why exactly is that?
Let's try to average the digit sums in a clever way by grouping them in groups of 2 = 2 1 and 4 = 2 2 respectively.
decimal | 0 1 0 | 1 1 0 | 2 1 0 | 3 1 0 | 4 1 0 | 5 1 0 | 6 1 0 | 7 1 0 | 8 1 0 | 9 1 0 | 1 0 1 0 | 1 1 1 0 | 1 2 1 0 | 1 3 1 0 | 1 4 1 0 | 1 5 1 0 | … |
binary | 0 2 | 1 2 | 1 0 2 | 1 1 2 | 1 0 0 2 | 1 0 1 2 | 1 1 0 2 | 1 1 1 2 | 1 0 0 0 2 | 1 0 0 1 2 | 1 0 1 0 2 | 1 0 1 1 2 | 1 1 0 0 2 | 1 1 0 1 2 | 1 1 1 0 2 | 1 1 1 1 2 | … |
digit sum | 0 | 1 | 1 | 2 | 1 | 2 | 2 | 3 | 1 | 2 | 2 | 3 | 2 | 3 | 3 | 4 | … |
group average | 2 1 | 2 2 | 2 3 | 2 4 | 2 5 | 2 6 | 2 7 | 2 9 | … | ||||||||
group average | 1 | 2 | 2 | 3 | … |
It looks like the average in every group just follows the same pattern as the digit sums. And this pattern will indeed continue. This is because the binary numbers from 2 n to 2 n + 1 − 1 are written almost like the numbers from 0 to 2 n , except for another digit 1 in the front, so their digit sum is just one more. Therefore, their average is 1 more than the average of the first half. The average of all numbers is the average of these two (since they both contain 2 n numbers ), so 2 1 more than the previous term. We can group the terms again and again until we get to a single number that is the average of all digit sums.
The formula for the average digit sum is indeed
∅ 2 ( n ) = 2 1 n
Let's try to do the same trick for base 3. This time, we can't group 4 numbers, but rather 3.
decimal | 0 1 0 | 1 1 0 | 2 1 0 | 3 1 0 | 4 1 0 | 5 1 0 | 6 1 0 | 7 1 0 | 8 1 0 | 9 1 0 | 1 0 1 0 | 1 1 1 0 | 1 2 1 0 | 1 3 1 0 | 1 4 1 0 | 1 5 1 0 | 1 6 1 0 | 1 7 1 0 | … |
binary | 0 2 | 1 2 | 2 3 | 1 0 3 | 1 1 3 | 1 2 3 | 2 0 3 | 2 1 3 | 2 2 3 | 1 0 0 3 | 1 0 1 3 | 1 0 2 3 | 1 1 0 3 | 1 1 1 3 | 1 1 2 3 | 1 2 0 3 | 1 2 1 3 | 1 2 2 3 | … |
digit sum | 0 | 1 | 2 | 1 | 2 | 3 | 2 | 3 | 4 | 1 | 2 | 3 | 2 | 3 | 4 | 3 | 4 | 5 | … |
group average | 1 | 2 | 3 | 2 | 3 | 4 | … |
Again, the pattern repeats self-similarly, and we can write the formula
∅ 3 ( n ) = n
Now, it's time to generalize. What we've got so far is
∅ 2 ( n ) = 2 1 n
∅ 3 ( n ) = n = 2 2 n
The self-similar pattern will continue in all bases and the argument as explained for base 2 will also always work, so the general expreasion for ∅ b ( n ) is
∅ b ( n ) = 2 b − 1 n .
After all this, we can simply plug in b = 2 5 , n = 2 0 1 8
∅ 2 5 ( 2 0 1 8 ) = 2 2 5 − 1 ⋅ 2 0 1 8 = 1 2 ⋅ 2 0 1 8 = 2 4 2 1 6
Problem Loading...
Note Loading...
Set Loading...
Let us first find a general equation for the average of all the digit sums of all nonnegative integers less than b n written down in base b .
Including zeroes as leading digits, there are n b n total digits. Since they all appear equally, each digit from 0 to b appears b n b n times, which makes the sum of all the digits b n b n ( 0 + 1 + 2 + . . . + ( b − 1 ) ) and the average of all the digit sums b ⋅ b n n b n ( 0 + 1 + 2 + . . . + ( b − 1 ) ) or b n ( 0 + 1 + 2 + . . . + ( b − 1 ) ) .
The sum 0 + 1 + 2 + . . . + ( b − 1 ) can be expressed as 2 b ( b − 1 ) . Substituting this in, the average of all the digit sums is now b n ( 2 b ( b − 1 ) ) or 2 n ( b − 1 ) .
In this problem, b = 2 5 and n = 2 0 1 8 , so the average of all the digit sums is 2 2 0 1 8 ( 2 5 − 1 ) = 2 4 2 1 6 .