I know the answer can be achieved by modular arithmetic but I have no clue how.
-
2Hint: It is the same remainder you would get when you divide the sum $$1+2+\cdots+2016.$$ Do you see why? – Jyrki Lahtonen Jun 29 '17 at 04:16
-
2And, as your friendly moderator I recommend that you familiarize yourself with our How to ask -page. Otherwise your questions may attract negative attention from the regulars. – Jyrki Lahtonen Jun 29 '17 at 04:18
-
Hint $ $ Use Wilson's generalization fo Gauss's grade-school trick – Bill Dubuque Jul 08 '17 at 14:11
4 Answers
\begin{align} &\sum_{i=2018}^{4033} i \mod 2017\\&\equiv\sum_{i=1}^{2016} (i+2017) \mod 2017 \\& \equiv \sum_{i=1}^{2016} i \mod 2017 \\&\equiv1+2+ \ldots+2015+2016 \mod 2017 \\&\equiv1+2+\ldots+(-2)+(-1) \mod 2017 \text{, match the $i$-th term with $2017-i$ term} \\&\equiv 0 \end{align}
- 149,520
- 20
- 88
- 149
$2018 + \dots + 4033 \equiv 1 + \dots + 2016 \equiv (2016^2 + 2016)/2 \equiv (-1^2 - 1)/2 \equiv 0 \mod 2017$.
There was probably a nicer way to do this by pairing up the numbers with their inverses, but I misread this question and was halfway through the answer when I was double checking. C'est la vie.
- 6,928
- 1
- 20
- 38
Note that $$2018 \equiv 1 \mod 2017$$ $$2019 \equiv 2 \mod 2017$$ $$...$$ $$4033 \equiv 2016 \mod (2017)$$ Adding all of these $$2018+2019+...+4033 \equiv 1+2+...+2016=\frac{(2016)(2017)}{2}\equiv 0 \mod 2017$$
- 4,083
Way 1: You add $2018+\dots +4033$ which is $(1+\dots +4033)-(1+\dots 2017)$, you need to calculate a lot for this way.
Way 2: If you divide $a+b$ by $m$, and you get $c$, then $c$ can also be remainder of $a$ + remainder of $b$ if the value you get is smaller than $m$. If remainder of $a$ + remainder of $b$$>m$, you just have divide remainder of $a$ + remainder of $b$ once again to get the value $c$. Can you see why? Hint: Note that you can write a natural number $g\geq m$ in this way: $g=md+r$, when you divide $g$ by $m$ where $d$ is natural number and $0\leq r<m$.
This simply implies $a\equiv s$, $b\equiv t$, then $a+b\equiv s+t$.
Note that $2017+k\equiv k$, $1\leq k\leq 1008$ and $4034-k\equiv -k$, $1\leq k\leq 1008$. Sum up, you get $2018+\dots +4033\equiv 0$.
- 5,381