If $S_{100} - k + k² = 7500$ and $S_{100}$ it is the sum of $100$ consecutive positive integers, then what it is the value o k? $k$ must be one of the 100 consecutive integers.
I know the answers are $50$ and $26$.
But I got stuck into getting these numbers.
Here is what I tried:
$S_{100} = \frac{(n+n+99)\times100}{2} \implies S_{100} - k + k² = 7500 \implies \frac{(n+n+99)\times100}{2} + k(k-1) = 7500 \implies k(k-1) = 7500 - 50(2n+99)\implies k(k-1)= 50(51-2n) $.
It's easy to see that $n = 1 \implies k = 50$ is an answer. But how can I discover that $n = 19 \implies k = 26$?
 A: $$\sum_{i=n}^{n+99} i = \sum_{i=1}^{n+99} i - \sum_{i=1}^{n-1} i = \dbinom{n+100}{2} - \dbinom{n}{2} = \dfrac{(n+100)(n+99)}{2} - \dfrac{n(n-1)}{2} = \dfrac{n^2+199n+9900}{2} - \dfrac{n^2-n}{2} = \dfrac{200n+9900}{2}$$
Then you have:
$$\dfrac{200n+9900}{2}+k^2-k = 7500$$
Multiplying out:
$$k^2-k+100n-2550 = 0$$
$$k = \dfrac{1\pm \sqrt{10201-400n}}{2}$$
So, $10201-400n$ must be an odd perfect square.
You can add the numbers $1$ through $100$ and $k=50$.
Or you can have the numbers $19$ through $118$ and $k=26$
A: Let's start with $$k^2-k = 50(51-2n)$$
Then we must have $k^2-k \equiv 0 \pmod{50}$. 
We split this up into $k^2-k \equiv 0 \pmod 2$ and $k^2-k \equiv 0 \pmod{25}$.
\begin{align}
   k^2-k &\equiv 0 \pmod{25} \\
   k(k-1) &\equiv 0 \pmod{25} \\
   k &\equiv 0, 1 \pmod {25}
\end{align}
Similarly, $k \equiv 0,1 \pmod 2$.
\begin{array}{c|ccc}
   & \pmod{2} & \pmod{25} \\
\hline
   25 & 1 & 0 \\
    2 & 0 & 2 \\
\hline
  25 & 1 & 0 \\
  26 & 0 & 1 \\
\hline
\end{array}
Hence, if $k \equiv x \pmod 2$ and $k \equiv y \pmod{25}$, Then 
$k \equiv 25x + 26y \pmod {50}$.
\begin{array}{cc|ccc}
   x \pmod 2 & y \pmod{25} & k \pmod{50} & \dfrac{k(k-1)}{50} & n \\
\hline
  0 & 0 &  0  &  0 & *\\
  \color{red}0 & \color{red}1 & \color{red}{26}  & \color{red}{13} & \color{red}{19}\\
  1 & 0 & 25  & 12 & *\\
  1 & 1 &  1  &  0 & *\\
\hline
\end{array}
