Just Sum Logs

Algebra Level 4

Evaluate:

a = 2 100 b = 2 100 log b a \large \sum _{ a=2 }^{ 100 }{ \sum _{ b=2 }^{ 100 }{ \left\lfloor \log _{ b }{ a } \right\rfloor } }

Notation: \lfloor \cdot \rfloor denotes the floor function .

Bonus: Find an efficient way to do this problem without using a program.


The answer is 5890.

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

Chew-Seong Cheong
Jun 19, 2018

Relevant wiki: Arithmetic-Geometric Progression

Note that for log b a = k \left \lfloor \log_b a \right \rfloor = k for b k a < b k + 1 b^k \le a < b^{k+1} , where k k is a positive integer. Therefore, a = b k b k + 1 1 log b a = ( b k + 1 b k ) k = ( b 1 ) k b k \displaystyle \sum_{a = b^k}^{b^{k+1}-1} \left \lfloor \log_b a \right \rfloor = \left(b^{k+1}-b^k\right)k = (b-1)kb^k . And the general solution is

S b = ( b 1 ) k = 1 n 1 k b k + ( 101 b n ) n An AGP sum = ( n 1 ) b n b ( b n 1 1 ) b 1 + ( 101 b n ) n where n = log b 100 S 2 = 5 ( 2 6 ) 2 ( 2 5 1 ) 1 + ( 101 2 6 ) 6 = 480 S 3 = 3 ( 3 4 ) 3 ( 3 3 1 ) 2 + ( 101 3 4 ) 4 = 284 S 4 = 2 ( 4 3 ) 4 ( 4 2 1 ) 3 + ( 101 4 3 ) 3 = 219 \begin{aligned} S_b & = (b-1){\color{#3D99F6}\sum_{k=1}^{{\color{#D61F06}n}-1}kb^k} + \left(101-b^{\color{#D61F06}n}\right)\color{#D61F06}n & \small \color{#3D99F6} \text{An AGP sum} \\ & = ({\color{#D61F06}n}-1)b^{\color{#D61F06}n} - \frac {b(b^{{\color{#D61F06}n}-1}-1)}{b-1}+ \left(101-b^{\color{#D61F06}n}\right)\color{#D61F06}n & \small \color{#D61F06} \text{where } n = \left \lfloor \log_b 100 \right \rfloor \\ S_2 & = 5(2^6) - \frac {2(2^5-1)}1 + (101-2^6)6 = 480 \\ S_3 & = 3(3^4) - \frac {3(3^3-1)}2 + (101-3^4)4 = 284 \\ S_4 & = 2(4^3) - \frac {4(4^2-1)}3 + (101-4^3)3 = 219 \end{aligned}

For 5 b 10 5 \le b \le 10 , n = log b 100 = 2 n = \left \lfloor \log_b 100 \right \rfloor = 2 , then

S b = 202 b 2 b b = 5 10 S b = b = 5 10 ( 202 b 2 b ) = 202 ( 6 ) 10 ( 11 ) ( 21 ) 6 + 4 ( 5 ) ( 9 ) 6 10 ( 11 ) 2 + 4 ( 5 ) 2 = 812 \begin{aligned} S_b & = 202-b^2 - b \\ \implies \sum_{b=5}^{10} S_b & = \sum_{b=5}^{10} \left(202-b^2 - b\right) = 202(6) - \frac {10(11)(21)}6 + \frac {4(5)(9)}6 - \frac {10(11)}2 + \frac {4(5)}2 = 812 \end{aligned}

For 11 b 100 11 \le b \le 100 , n = 1 n=1 , then S b = 101 b S_b = 101 - b b = 11 100 ( 101 b ) = k = 1 90 k = 90 ( 91 ) 2 = 4095 \implies \displaystyle \sum_{b=11}^{100} (101-b) = \sum_{k=1}^{90} k = \frac {90(91)}2 = 4095 .

Therefore, a = 2 100 b = 2 100 log b a = b = 2 100 S b = 480 + 284 + 219 + 812 + 4095 = 5890 \displaystyle \sum _{a=2}^{100} \sum _{b=2}^{100} \left\lfloor \log_b a \right\rfloor = \sum_{b=2}^{100} S_b = 480+284+219+812+4095 = \boxed{5890} .

Zico Quintina
Jun 19, 2018

We will use the fact that log b a = k \lfloor \log_b a \rfloor = k iff b k a < b k + 1 b^k \le a < b^{k+1} , and this inequality holds for exactly b k + 1 b k = b k ( b 1 ) b^{k+1} - b^k = b^k (b - 1) natural numbers.

To develop this into a formula, we consider what happens when b = 4 b = 4 . For a < 4 a < 4 , we will have log 4 a = 0 \lfloor \log_4 a \rfloor = 0 , so they contribute nothing to our sum. When 4 a < 4 2 4 \le a < 4^2 , we will have log 4 a = 1 \lfloor \log_4 a \rfloor = 1 , and there will be 4 ( 3 ) 4(3) such terms, so they contribute 4 ( 3 ) 1 4(3) \cdot 1 to our sum. Similarly, when 4 2 a < 4 3 4^2 \le a < 4^3 , we will have log 4 a = 2 \lfloor \log_4 a \rfloor = 2 , and there will be 4 2 ( 3 ) 4^2(3) such terms, so they contribute 4 2 ( 3 ) 2 4^2(3) \cdot 2 to our sum. Now, however, we have to use a different formula for the contribution of the remaining terms, because the next power, 4 4 4^4 is greater than 100 100 . So for 4 3 a 100 4^3 \le a \le 100 , we will have log 4 a = 1 \lfloor \log_4 a \rfloor = 1 , and there will be 100 4 3 + 1 100 - 4^3 + 1 such terms, so they contribute ( 100 4 3 + 1 ) 3 (100 - 4^3 + 1) \cdot 3 to our sum. So the total contribution to our sum for b = 4 b = 4 is

4 ( 3 ) 1 + 4 2 ( 3 ) 2 + ( 100 4 3 + 1 ) 3 = 219 4(3) \cdot 1 + 4^2(3) \cdot 2 + (100 - 4^3 + 1) \cdot 3 = 219

In general, for b = k b = k , the contribution will be

k ( k 1 ) 1 + k 2 ( k 1 ) 2 + k 3 ( k 1 ) 3 + . . . . + k n 1 ( k 1 ) ( n 1 ) + ( 100 k n + 1 ) n k(k - 1) \cdot 1 + k^2(k - 1) \cdot 2 + k^3(k - 1) \cdot 3 \ + .... + \ k^{n - 1}(k - 1) \cdot (n-1) + (100 - k^n + 1) \cdot n

where n N n \in \mathbb{N} is the highest exponent such that k n 100 k^n \le 100 .

Admittedly, this is not very efficient for very low values of b \ b , even if there's a fairly simple pattern to the terms; however, the number of terms quickly decreases as there are fewer and fewer powers of b \ b \ under 100 100 , and in fact as we will see, when b > 10 \ b > 10 \ we will be able to count all the contributions in one step.

\begin{aligned} &b = 2: \qquad &&2(1) \cdot 1 + 2^2(1) \cdot 2 + 2^3(1) \cdot 3 + 2^4(1) \cdot 4 + 2^5(1) \cdot 5 + (100 - 2^6 + 1) \cdot 6 &= 480 \\ &b = 3: &&3(2) \cdot 1 + 3^2(2) \cdot 2 + 3^3(2) \cdot 3 + (100 - 3^4 + 1) \cdot 4 &= 284 \\ &b = 4: &&4(3) \cdot 1 + 4^2(3) \cdot 2 + (100 - 4^3 + 1) \cdot 3 &= 219 \\ &b = 5: &&5(4) \cdot 1 + (100 - 5^2 + 1) \cdot 2 &= 172 \\ &b = 6: &&6(5) \cdot 1 + (100 - 6^2 + 1) \cdot 2 &= 160 \\ &b = 7: &&7(6) \cdot 1 + (100 - 7^2 + 1) \cdot 2 &= 146 \\ &b = 8: &&8(7) \cdot 1 + (100 - 8^2 + 1) \cdot 2 &= 130 \\ &b = 9: &&9(8) \cdot 1 + (100 - 9^2 + 1) \cdot 2 &= 112 \\ &b = 10: &&10(9) \cdot 1 + (100 - 10^2 + 1) \cdot 2 &= 92 \\ &\hline \\ & b = 2 \text{ to } 10: &&\text{ } &= 1795 \end{aligned}

For b 11 b \ge 11 we will only have one term, namely ( 100 b + 1 ) 1 (100 - b +1) \cdot 1 as there is only a single power of b b under 100. So all those contributions can be calculated as

b = 11 100 ( 101 b ) = c = 1 90 c [Using the substitution c = 101 b ] = ( 90 ) ( 91 ) 2 = 4095 \begin{aligned} \sum_{b = 11}^{100} (101 - b) &= \sum_{c = 1}^{90} c \qquad \qquad \small \text{[Using the substitution } c = 101 - b \ ] \\ \\ &= \dfrac{(90)(91)}{2} \\ \\ &= 4095 \end{aligned}

Thus we finally arrive (not too painfully) at

a = 2 100 b = 2 100 log b a = 1795 + 4095 = 5890 \sum_{a = 2}^{100} \sum_{b = 2}^{100} \lfloor \log_b a \rfloor = 1795 + 4095 = \boxed{5890}

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...