What are the divisors of 948?
1, 2, 3, 4, 6, 12, 79, 158, 237, 316, 474, 948
- There is a total of 12 positive divisors.
- The sum of these divisors is 2240.
- The arithmetic mean is 186.66666666667.
8 even divisors
2, 4, 6, 12, 158, 316, 474, 948
4 odd divisors
1, 3, 79, 237
How to compute the divisors of 948?
A number N is said to be divisible by a number M (with M non-zero) if, when we divide N by M, the remainder of the division is zero.
Brute force algorithm
We could start by using a brute-force method which would involve dividing 948 by each of the numbers from 1 to 948 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 948 / 1 = 948 (the remainder is 0, so 1 is a divisor of 948)
- 948 / 2 = 474 (the remainder is 0, so 2 is a divisor of 948)
- 948 / 3 = 316 (the remainder is 0, so 3 is a divisor of 948)
- ...
- 948 / 947 = 1.0010559662091 (the remainder is 1, so 947 is not a divisor of 948)
- 948 / 948 = 1 (the remainder is 0, so 948 is a divisor of 948)
Improved algorithm using square-root
However, there is another slightly better approach that reduces the number of iterations by testing only integers less than or equal to the square root of 948 (i.e. 30.789608636681). Indeed, if a number N has a divisor D greater than its square root, then there is necessarily a smaller divisor d such that:
(thus, if , then )
- 948 / 1 = 948 (the remainder is 0, so 1 and 948 are divisors of 948)
- 948 / 2 = 474 (the remainder is 0, so 2 and 474 are divisors of 948)
- 948 / 3 = 316 (the remainder is 0, so 3 and 316 are divisors of 948)
- ...
- 948 / 29 = 32.689655172414 (the remainder is 20, so 29 is not a divisor of 948)
- 948 / 30 = 31.6 (the remainder is 18, so 30 is not a divisor of 948)