2

After some time I gave up and cheated using Wolfram Alpha and got the result $4076363$.

I played around with the general statement

What is the remainder when $x^x-x$ is divided by $x^2+x+1$ where $x$ is an integer.

After trying few valuesenter image description here

I noticed that when $x$ is a multiple if $3$ the remainder is $x^2+2$. As $ 2019$ is a multiple of $3$, we can test $x=2019$ surprisingly I got the correct answer.

Let $x=3k$. After some modular arithmetic manipulation, this all boils down to proving

$(3k)^{3k} \cong 1 (mod 9k^2+3k+1)$ where $k = 0,1,2...$

Again after playing around I noticed that $ 3k|\phi(9k^2+3k+1)$. I don't know whether this would be helpful in proving. How can I progress from here? Please try to post an elementary solution as I am just a high school student.

1 Answers1

3

$2019$ is divisible by $3$, so $2019^{2019}-1$ is divisible by $2019^3-1$.

In turn, $2019^3-1$ is divisible by $2019^2+2019+1$.

Therefore, $2019^{2019}-1$ is divisible by $2019^2+2019+1$.

Therefore, the remainder when $2019^{2019}-2019$ is divided by $2019^2+2019+1$

is $2019^2+2019+1-2018=2019^2+2$.

J. W. Tanner
  • 60,406