Difference of the cube and its number
=n3−n=n(n2−1)=n(n−1)(n+1)=(n−1)n(n+1)
When ever a number is divided by 3 it leaves a remainder 0,1 or 2
So the number is of form n=3p,3p+1,3p+2
If n=3p then n is divisible by 3
If n=3p+1 then n−1=3p+1−1=3p which is divisible by 3
If n=3p+2 then n+1=3p+2+1=3p+3=3(p+1) which is divisible by 3
So of of the consecutive terms is always divisible by 3
Atleast one of the three consecutive numbers will always be even so it will be divisible by 2
Hence proved that (n−1)n(n+1) will always be divisible by 6
So when n3−n is divided by 6 it leaves remainder 0
⇒n3 and n when divided by 6 leaves same remainder