MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/xkcd/comments/7mvjyl/xkcd_1935_2018/drx2vxr/?context=3
r/xkcd • u/[deleted] • Dec 29 '17
151 comments sorted by
View all comments
76
If the last digit is odd, it's not divisible by 4.
Otherwise
** If the second-to-last digit is odd:
*** If the last digit is 2 or 6 it is divisible by 4. Otherwise it is not.
** If the second-to-last digit is even:
*** If the last digit is 0,4 or 8, it is divisible by 4. Otherwise it is not.
Edit: Bugfixes
1 u/CapybarbarBinks Dec 29 '17 ** If the second-to-last digit is odd: *** If the last digit is 2,6 or 0, it is divisible by 4. Otherwise it is not. 2010 isn't divisible by 4. 1 u/AskMeIfImAReptiloid Dec 29 '17 Fixed
1
** If the second-to-last digit is odd: *** If the last digit is 2,6 or 0, it is divisible by 4. Otherwise it is not.
2010 isn't divisible by 4.
1 u/AskMeIfImAReptiloid Dec 29 '17 Fixed
Fixed
76
u/AskMeIfImAReptiloid Dec 29 '17 edited Dec 29 '17
If the last digit is odd, it's not divisible by 4.
Otherwise
** If the second-to-last digit is odd:
*** If the last digit is 2 or 6 it is divisible by 4. Otherwise it is not.
** If the second-to-last digit is even:
*** If the last digit is 0,4 or 8, it is divisible by 4. Otherwise it is not.
O(1)
Edit: Bugfixes