So Loooong

Algebra Level 5

x 1 + x 2 + x 3 + + x 2016 + x 2017 |x -1| + |x - 2| + |x - 3| + \cdots + |x - 2016| + |x - 2017|

Find the number of positive factors of the minimum value of the above expression?

Notation: | \cdot | denotes the absolute value function.


The answer is 60.

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

Mark Hennings
Jul 14, 2017

It is elementary that f ( x ) = x a + x b f(x) = |x-a| + |x-b| is constant for a x b a \le x \le b , and is certainly minimized at x = 1 2 ( a + b ) x = \tfrac12(a+b) .

Thus each of the functions x 1 + x 2017 |x-1| + |x-2017| , x 2 + x 2016 |x-2| + |x-2016| , x 3 + x 2015 |x-3| + |x-2015| , ... , x 1008 + x 1010 |x-1008| + |x-1010| , as well as the function x 1009 |x-1009| , are minimized at x = 1009 x=1009 . Thus the minimum value of the function x 1 + x 2 + + x 2017 |x-1| + |x-2| + \cdots + |x-2017| occurs at x = 1009 x=1009 , and is 2 ( 1 + 2 + 1008 ) + 0 = 1008 × 1009 = 2 4 × 3 2 × 7 × 1009 2(1 + 2 + \cdots 1008) + 0 \; = \; 1008 \times 1009 \; = \; 2^4 \times 3^2 \times 7 \times 1009 a number which has 5 × 3 × 2 × 2 = 60 5 \times 3 \times 2 \times 2 = \boxed{60} positive factors.

Zach Abueg
Jul 13, 2017

For a set S S with n n elements such that s 1 < s 2 < < s n s_1 < s_2 < \cdots < s_n , s S x s \displaystyle \sum_{s \ \in \ S} |x - s| is minimized when x x is the median of S S .

Let's show this intuitively before proving it rigorously.

Intuition

Imagine the given values as trees along a road. The quantity you are trying to minimize is the sum of distances between you and each of the trees.

Suppose that you are standing at the median, and you know the current value of the sum. How will it change if you move in either direction? Note that regardless of which direction you choose, in each moment you will be moving away from at least half of the trees, and towards at most half of the trees. Therefore, the sum of distances can never decrease -- and that means the sum of distances at the beginning had to be optimal.

Proof

Suppose that the set S S has n n elements, s 1 < s 2 < < s n s_1 < s_2 < \cdots < s_n . If x < s 1 x < s_1 , then

f ( x ) = s S x s = s S s x = s S ( s x ) = k = 1 n ( s k x ) \displaystyle \begin{aligned} f(x) = \sum_{s \ \in \ S} |x - s| = \sum_{s \ \in \ S} |s - x| = \sum_{s \ \in \ S} \left(s - x\right) = \sum_{k = 1}^{n} \left(s_k - x\right) \end{aligned}

As x x increases, each term of f ( x ) f(x) decreases until x x reaches x 1 x_1 , so f ( s 1 ) < f ( x ) f(s_1) < f(x) for all x < s 1 x < s_1 .

Now suppose that s k x x + d s k + 1 s_ k \leq x \leq x+d \leq s_k + 1 . Then

f ( x + d ) = i = 1 k ( x + d s i ) + i = k + 1 n ( s i ( x + d ) ) = d k + i = 1 k ( x s i ) d ( n k ) + i = k + 1 n ( s i x ) = d ( 2 k n ) + i = 1 k ( x s i ) + i = k + 1 n ( s i x ) = d ( 2 k n ) + f ( x ) \displaystyle \begin{aligned} f(x + d) & = \sum_{i \ = \ 1}^{k} \left(x + d - s_i\right) + \sum_{i \ = \ k + 1}^{n} \left(s_i - (x + d)\right) \\ & = dk + \sum_{i \ = \ 1}^{k} \left(x - s_i\right) - d(n - k) + \sum_{i \ = \ k + 1}^{n} \left(s_i - x\right) \\ & = d(2k - n) + \sum_{i \ = \ 1}^{k} \left(x - s_i\right) + \sum_{i \ = \ k + 1}^{n} \left(s_i - x\right) \\ & = d(2k - n) + f(x) \end{aligned}

so f ( x + d ) f ( x ) = d ( 2 k n ) f(x + d) - f(x) = d(2k - n) . This is negative if 2 k < n 2k < n , zero if 2 k = n 2k = n , and positive if 2 k > n 2k > n . Thus, on the interval [ s k , s k + 1 ] \left[s_k, s_{k+1}\right] ,

f ( x ) is { decreasing, if 2 k < n constant, if 2 k = n increasing, if 2 k > n \displaystyle f(x) \ \text{is } \begin{cases} \text{decreasing, } & \text{if } 2k < n \\ \text{constant, } & \text{if } 2k = n \\ \text{increasing, } & \text{if } 2k > n \end{cases}

In particular, we note that when 2 k = n 2k = n , the sum stays constant. What this translates to for our tree analogy is that the sum of the distances does not "tend" toward one direction or another. Finally, we note that since 2 k = n 2k = n , k k is the median of our set S S .

Thus, we have proven that for a set S S with n n elements such that s 1 < s 2 < < s n s_1 < s_2 < \cdots < s_n , s S x s \displaystyle \sum_{s \ \in \ S} |x - s| is minimized when x x is the median of S S . Now let's work through the problem.

\underline{\hspace{9 in}}

f ( x ) = x 1 + x 2 + x 3 + + x 2016 + x 2017 = n = 1 2017 x n \displaystyle \begin{aligned} f(x) & = |x -1| + |x - 2| + |x - 3| + \cdots + |x - 2016| + |x - 2017| \\ & = \sum_{n \ = \ 1}^{2017} |x - n| \end{aligned}

f ( x ) f(x) is minimized when x x is the median of the set S = { 1 , 2 , 3 , 2016 , 2017 } S = \{1, 2, 3, \ldots 2016, 2017\} . Since S S is a uniform distribution, the median equals the mean of the set, so the median is x = 1 + 2017 2 = 1009 \displaystyle x = \frac{1 + 2017}{2} = 1009 . We have

f ( 1009 ) = n = 1 2017 1009 n = 2 n = 1 1009 ( 1009 n ) = 2 n = 1 1009 1009 2 n = 1 1009 n = ( 2 1009 1009 ) ( 2 1009 1010 2 ) = 1008 1009 = 2 4 3 2 7 1009 \displaystyle \begin{aligned} f(1009) & = \sum_{n \ = \ 1}^{2017} |1009 - n| \\ & = 2\sum_{n \ = \ 1}^{1009} (1009 - n) \\ & = 2\sum_{n \ = \ 1}^{1009} 1009 - 2\sum_{n \ = \ 1}^{1009} n \\ & = \left(2 \cdot 1009 \cdot 1009\right) - \left(2 \cdot \frac{1009 \cdot 1010}{2}\right) \\ & = 1008 \cdot 1009 \\ & = 2^4 \cdot 3^2 \cdot 7 \cdot 1009 \end{aligned}

The number of factors of f ( 1009 ) f(1009) is ( 4 + 1 ) ( 2 + 1 ) ( 1 + 1 ) ( 1 + 1 ) = 60 (4 + 1)(2 + 1)(1 + 1)(1 + 1) = \boxed{60} .

WOW!!! Great insight...

Ravneet Singh - 3 years, 11 months ago

Log in to reply

Thanks, Ravneet!

Zach Abueg - 3 years, 11 months ago
Chew-Seong Cheong
Jul 13, 2017

Let S ( n ) = k = 1 n x k S(n) = \displaystyle \sum_{k=1}^n |x-k| . Then we have:

  • For S ( 1 ) = x 1 S(1) = |x-1| , then min ( S ( 1 ) ) = 1 1 = 0 \min (S(1)) = |1-1| = 0 when x = 1 x=1 .
  • For S ( 3 ) = x 1 + x 2 + x 3 S(3)= |x-1| + |x-2|+|x-3| , then min ( S ( 3 ) ) = 2 1 + 2 2 + 2 3 = 2 \min (S(3)) = |2-1| + |2-2|+|2-3| = 2 when x = 2 x=2 .
  • For S ( 5 ) = x 1 + x 2 + x 3 + x 4 + x 5 S(5)= |x-1| + |x-2|+|x-3| + |x-4|+|x-5| , then min ( S ( 5 ) ) = 3 1 + 3 2 + 3 3 + 3 4 + 3 5 = 6 \min (S(5)) = |3-1| + |3-2|+|3-3| + |3-4|+|3-5| = 6 when x = 3 x=3 .
  • For S ( 2 n + 1 ) = k = 1 2 n + 1 x k S(2n+1) = \displaystyle \sum_{k=1}^{2n+1} |x-k| , then min S ( 2 n + 1 ) = n ( n + 1 ) \min S(2n+1) = n(n+1) when x = n + 1 x=n+1 .
  • For S ( 2017 ) = k = 1 2017 x k S(2017) = \displaystyle \sum_{k=1}^{2017} |x-k| , then min S ( 2017 ) = 1008 ( 1009 ) \min S(2017) = 1008(1009) when x = 1009 x=1009 .

S ( 2017 ) = 1008 ( 1009 ) = 2 4 × 3 2 × 7 × 1009 \implies S(2017) = 1008(1009) = 2^4\times 3^2 \times 7 \times 1009 . The number of factors is ( 4 + 1 ) ( 3 + 1 ) ( 1 + 1 ) ( 1 + 1 ) = 60 (4+1)(3+1)(1+1)(1+1) = \boxed{60} .

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...