Prove that an integer is divisible by 4 iff its last digit plus twice its second from last digit is divisible by 4.
For example, 1084 is divisible by 4 because 4+8x2 = 20 is divisible by 4 as well.
For simplicity let's focus on positive integers. we can express a positive integer as: N=100c+R = 25*4*c + R where c and R are positive integers, and R<100 Since 25*4*c is always divisible by 4, we only need to be concerned with R being divisible by 4. We can write R as follows: R=a*10+b where a,b are positive integers < 10 R= 5*2a + b First direction: if (b+2a) is divisible by 4 - then: b+2a=4m , where m is a positive integer --> b=4m-2a R = 5*2a + b = 5*2a + 4m - 2a = 4a + 4m = 4(a+m) R=4(a+m) --> R is divisible by 4 Opposite direction: R=a*10+b where a,b are positive integers < 10 , and R is divisible by 4 R= 10a + b = 8a + 2a + b --> 8a+(2a+b) is divisible by 4 --> 2a+b is divisible by 4 (since 8a is divisible by 4)
but you may have a one - liner that proves all that :)
Good proof! My proof revolves around the following: (100x + 10y + z) mod 4 = (100x mod 4) + (10y mod 4) + (z mod 4) = 0 + (2y mod 4) + (z mod 4) = (2y+z) mod 4 So if 100x+10y+z = 0 mod 4, then 2y+z = 0 mod 4 as well.
very cool! A two liner this time LOL .
Join our real-time social learning platform and learn together with your friends!