What are the divisors of 5845?
1, 5, 7, 35, 167, 835, 1169, 5845
- There is a total of 8 positive divisors.
- The sum of these divisors is 8064.
- The arithmetic mean is 1008.
8 odd divisors
1, 5, 7, 35, 167, 835, 1169, 5845
How to compute the divisors of 5845?
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 5845 by each of the numbers from 1 to 5845 to determine which ones have a remainder equal to 0.
(where is the integer part of the quotient)
- 5845 / 1 = 5845 (the remainder is 0, so 1 is a divisor of 5845)
- 5845 / 2 = 2922.5 (the remainder is 1, so 2 is not a divisor of 5845)
- 5845 / 3 = 1948.3333333333 (the remainder is 1, so 3 is not a divisor of 5845)
- ...
- 5845 / 5844 = 1.0001711156742 (the remainder is 1, so 5844 is not a divisor of 5845)
- 5845 / 5845 = 1 (the remainder is 0, so 5845 is a divisor of 5845)
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 5845 (i.e. 76.45259969419). 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 )
- 5845 / 1 = 5845 (the remainder is 0, so 1 and 5845 are divisors of 5845)
- 5845 / 2 = 2922.5 (the remainder is 1, so 2 is not a divisor of 5845)
- 5845 / 3 = 1948.3333333333 (the remainder is 1, so 3 is not a divisor of 5845)
- ...
- 5845 / 75 = 77.933333333333 (the remainder is 70, so 75 is not a divisor of 5845)
- 5845 / 76 = 76.907894736842 (the remainder is 69, so 76 is not a divisor of 5845)