Blog

Divisibility Rules

Published 1 min read

Divisibility rules to take the pain out of dividing big numbers
On computers, they come in handy when you have to handle numbers bigger than int or long as strings.

1: skip
2: the ones digit is a multiple of 2
3: the sum of all digits is a multiple of 3
4: the last two digits are 00 or a multiple of 4
5: the ones digit is 0 or 5
6: divisible by 2 && divisible by 3
7:
8: the last digits are 000 or a multiple of 8
9: the sum of all digits is a multiple of 9
10: the ones digit is 0
11: (sum of odd-position digits - sum of even-position digits) is a multiple of 11

Comments

Leaving a comment stores your nickname (or GitHub profile info). Privacy policy

GitHub