What are the divisors of 1878?
1, 2, 3, 6, 313, 626, 939, 1878
- There is a total of 8 positive divisors.
- The sum of these divisors is 3768.
- The arithmetic mean is 471.
4 even divisors
2, 6, 626, 1878
4 odd divisors
1, 3, 313, 939
How to compute the divisors of 1878?
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 1878 by each of the numbers from 1 to 1878 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 1878 / 1 = 1878 (the remainder is 0, so 1 is a divisor of 1878)
- 1878 / 2 = 939 (the remainder is 0, so 2 is a divisor of 1878)
- 1878 / 3 = 626 (the remainder is 0, so 3 is a divisor of 1878)
- ...
- 1878 / 1877 = 1.0005327650506 (the remainder is 1, so 1877 is not a divisor of 1878)
- 1878 / 1878 = 1 (the remainder is 0, so 1878 is a divisor of 1878)
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 1878 (i.e. 43.335897360041). 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 )
- 1878 / 1 = 1878 (the remainder is 0, so 1 and 1878 are divisors of 1878)
- 1878 / 2 = 939 (the remainder is 0, so 2 and 939 are divisors of 1878)
- 1878 / 3 = 626 (the remainder is 0, so 3 and 626 are divisors of 1878)
- ...
- 1878 / 42 = 44.714285714286 (the remainder is 30, so 42 is not a divisor of 1878)
- 1878 / 43 = 43.674418604651 (the remainder is 29, so 43 is not a divisor of 1878)