# what is 1^21 + 2^21 + 3^21 + ....... + 18^21 in mode 19?

#### ketanco

##### New member
what is 1^21 + 2^21 + 3^21 + ....... + 18^21 in mode 19?

i can only think about individually calculating equivalents in mode 19 and then adding them up but there must be a better way then finding equivalents of exponentials of numbers from to 1 to 18, as this question is expected to be solved in around 2 minutes or less...

#### Olinguito

##### Well-known member
By Fermat’s little theorem, $1^{18},2^{18},\ldots,18^{18}\equiv1\pmod{19}$. Hence
$$\begin{array}{rcl}1^{21}+\cdots+18^{21} &\equiv& 1^3+\cdots+18^3\pmod{19} \\\\ {} &=& (1+\cdots+18)^2\pmod{19} \\\\ {} &=& \left(\dfrac{18}2\cdot19\right)^2\pmod{19} \\\\ {} &\equiv& 0\pmod{19}.\end{array}$$

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Hey Olinguito , how does it follow that:
$$1^3+\cdots+18^3\pmod{19} = (1+\cdots+18)^2\pmod{19}$$ #### Olinguito

##### Well-known member
Hey Olinguito , how does it follow that:

$1^3+\cdots+18^3\pmod{19} = (1+\cdots+18)^2\pmod{19}$ Doesn’t $a=b$ imply $a\pmod n=b\pmod n$ (taking the modulus to be between $0$ and $n-1$)? Last edited:

#### Klaas van Aarsen

##### MHB Seeker
Staff member
Doesn’t $a=b$ imply $a\pmod n=b\pmod n$ (taking the modulus to be between $0$ and $n-1$)? After staring at the following picture long enough, I finally realized why $a=b$.  I think it's a different theorem though (Nicomachus's theorem).

Btw, couldn't we instead observe that:
$$1^3+2^3+...+17^3+18^3\equiv 1^3+2^3+...+(-2)^3+(-1)^3 \equiv 0 \pmod{19}$$ #### Olinguito

##### Well-known member
Btw, couldn't we instead observe that:
$$1^3+2^3+...+17^3+18^3\equiv 1^3+2^3+...+(-2)^3+(-1)^3 \equiv 0 \pmod{19}$$ That’s an excellent observation! #### ketanco

##### New member
After staring at the following picture long enough, I finally realized why $a=b$. I think it's a different theorem though (Nicomachus's theorem).

Btw, couldn't we instead observe that:
$$1^3+2^3+...+17^3+18^3\equiv 1^3+2^3+...+(-2)^3+(-1)^3 \equiv 0 \pmod{19}$$ yes this is how they xpected us to solve i think... this must be the answer. thanks