-1

What will be the reminder of (1n +2n +3n +4n)/5? Simply (1n +2n +3n +4n) mod 5=? Where n<=10100000.
My idea: The reminder may be 0 or 1 or 2 or 3 or 4 when a number is divided by 5.
We can easily calculate it when n is too small but when n is too big like n<=10100000 how can we calculate it?

Bill Dubuque
  • 272,048
Um_tam
  • 1

2 Answers2

0

Hint:

If $n$ is odd, $$1^n+4^n$$ is divisible by $1+4$ using Proof of $a^n+b^n$ divisible by $a+b$ when $n$ is odd

If $4\mid n, r^4\equiv1\pmod5$ for $r=1,2,3,4$ generally for $(r,5)=1$

If $n\equiv2\pmod4,$

$$1^n+2^n+3^n+4^n\equiv1^2+2^2+3^2+4^2\pmod5\equiv?\pmod5$$

0

We can reduce $n$ mod $4$ using Fermat's little theorem,

which indicates that $a^4\equiv1\bmod5$ when $\gcd(a,5)=1$.

J. W. Tanner
  • 60,406