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?
Asked
Active
Viewed 183 times
-1

Bill Dubuque
- 272,048

Um_tam
- 1
-
1Use Fermat's little theorem -- $a^4\equiv1\bmod5$ when $\gcd(a,5)=1$ -- to reduce $n$ mod $4$: – J. W. Tanner Nov 17 '20 at 16:01
-
The solution is in the web at many places, e.g. here. – Dietrich Burde Nov 17 '20 at 16:08
2 Answers
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$$

lab bhattacharjee
- 274,582
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