<s>[INST] 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$?
 [/INST] 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}
</s>