What are the divisors of 348?
1, 2, 3, 4, 6, 12, 29, 58, 87, 116, 174, 348
- There is a total of 12 positive divisors.
- The sum of these divisors is 840.
- The arithmetic mean is 70.
8 even divisors
2, 4, 6, 12, 58, 116, 174, 348
4 odd divisors
1, 3, 29, 87
How to compute the divisors of 348?
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 348 by each of the numbers from 1 to 348 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 348 / 1 = 348 (the remainder is 0, so 1 is a divisor of 348)
- 348 / 2 = 174 (the remainder is 0, so 2 is a divisor of 348)
- 348 / 3 = 116 (the remainder is 0, so 3 is a divisor of 348)
- ...
- 348 / 347 = 1.0028818443804 (the remainder is 1, so 347 is not a divisor of 348)
- 348 / 348 = 1 (the remainder is 0, so 348 is a divisor of 348)
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 348 (i.e. 18.654758106178). 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 )
- 348 / 1 = 348 (the remainder is 0, so 1 and 348 are divisors of 348)
- 348 / 2 = 174 (the remainder is 0, so 2 and 174 are divisors of 348)
- 348 / 3 = 116 (the remainder is 0, so 3 and 116 are divisors of 348)
- ...
- 348 / 17 = 20.470588235294 (the remainder is 8, so 17 is not a divisor of 348)
- 348 / 18 = 19.333333333333 (the remainder is 6, so 18 is not a divisor of 348)