I need help with this problem. If $a$ and $b$ are positive integers such that
$$|a-1|+|a-2|+|a-3|+\cdots+|a-2015|=b(b+1)$$
find the sum $a+b$.
I need help with this problem. If $a$ and $b$ are positive integers such that
$$|a-1|+|a-2|+|a-3|+\cdots+|a-2015|=b(b+1)$$
find the sum $a+b$.
if $f(x) = |x-1| +|x-2| +\cdots+|x-2015|,$ then $\begin{align} f(1008) &=1007 + 1006 + \cdots 2 + 1 + 0 + 1 + 2 + \cdots + 1006 + 1007\\ & = 2 \dfrac{(1+1007)}{2} 1007 \\ & = 1008*1007 \end{align}$
therefore $$ a = 1008, b = 1007, a+b = 2015$$
this is the only solution as the graph of $y = f(x)$ is made up of line segments symmetric about $x = 1008$ and can only cut $y =x^2 + x$ at two points.