What are the divisors of 4870?
1, 2, 5, 10, 487, 974, 2435, 4870
- There is a total of 8 positive divisors.
- The sum of these divisors is 8784.
- The arithmetic mean is 1098.
4 even divisors
2, 10, 974, 4870
4 odd divisors
1, 5, 487, 2435
How to compute the divisors of 4870?
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 4870 by each of the numbers from 1 to 4870 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 4870 / 1 = 4870 (the remainder is 0, so 1 is a divisor of 4870)
- 4870 / 2 = 2435 (the remainder is 0, so 2 is a divisor of 4870)
- 4870 / 3 = 1623.3333333333 (the remainder is 1, so 3 is not a divisor of 4870)
- ...
- 4870 / 4869 = 1.0002053809817 (the remainder is 1, so 4869 is not a divisor of 4870)
- 4870 / 4870 = 1 (the remainder is 0, so 4870 is a divisor of 4870)
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 4870 (i.e. 69.785385289472). 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 )
- 4870 / 1 = 4870 (the remainder is 0, so 1 and 4870 are divisors of 4870)
- 4870 / 2 = 2435 (the remainder is 0, so 2 and 2435 are divisors of 4870)
- 4870 / 3 = 1623.3333333333 (the remainder is 1, so 3 is not a divisor of 4870)
- ...
- 4870 / 68 = 71.617647058824 (the remainder is 42, so 68 is not a divisor of 4870)
- 4870 / 69 = 70.579710144928 (the remainder is 40, so 69 is not a divisor of 4870)