3 ms·
Why is the last digit of n^5 equal to the last digit of n? [video]
- panda88888 9y agoAt work so I haven’t watched the video yet, but my quick rationale is, Let m = abs(n) It follows n = sign(n) * m We can work with m since sign(n) doesn’t affect the ones digit of n^5. More formally, n^5 = sign(n)^5 * abs(n)^5. Let m = 10 * b + a, where b = floor(m/10) a = m % 10 Essentially we extract the ones digit as a. m^5 = (10 * b + a)^5 If we expand the terms, only a^5 affects the ones digit. The remaining has at least one 10 as factor. Quick python script will verify a^5 has a as the ones digit for 0...9. for a in range(10): print(pow(a, 5) == a) Edit: fixed formatting
- iamzlatan 9y agoIt's not exactly the same thing as he does in the video but it's also an interesting approach. Also in the video he assumes n is natural so no need to use sign(n).
- contravariant 9y agoThere are some slight problems with your proof, firstly your proof doesn't really use the fact that you're raising a number to the 5th power, except for the last part and secondly the last part (as it is currently written) will print "false" for all numbers other than 1. Also I don't think you need to bother with the sign of the number. Python is one of the few languages that took the sensible approach and made statements like (a % 10 = (a + 10) % 10) true for all a.
- panda88888 9y agoAh thanks! I was replying on my phone and the mod operator was lost during transcription.
- blt 9y agogood example of an inductive proof, would be helpful for people learning about inductive proofs.
- contravariant 9y agoA somewhat more general proof involves the use of the Chinese remainder theorem and the fact that 4 is divisible by the order of the multiplicative group of both integers mod 2 and mod 5. Therefore x^5 = x mod 2 and x^5 = x mod 5 for all x, and as a consequence x^5 = x mod 10 for all x. This construction seems to fail if the base isn't square free. In particular in base 4 the number 2 has as powers 2, 10, 20, 100 etc.
- knappa 9y agoThat's not true for x=2 : 2^4 = 6 mod 10 Also, 4 does not divide the order of the multiplicative group of Z/2Z. i.e. 4 does not divide 1. (Also, the claim was that x^5 = x mod 10 not x^5=1, but I assume that's a typo.)
- contravariant 9y agoHmm yes I suppose I was a bit sloppy, although I got the gist of it right somehow. I guess the problem here is that x^4 = 1 mod 2 is false if x = 0 mod 2, but x^5 = x mod 2 does hold for all numbers. I've fixed the problems you mentioned, thanks.