What are the divisors of 1162?

1, 2, 7, 14, 83, 166, 581, 1162

4 even divisors

2, 14, 166, 1162

4 odd divisors

1, 7, 83, 581

How to compute the divisors of 1162?

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.

N mod M = 0

Brute force algorithm

We could start by using a brute-force method which would involve dividing 1162 by each of the numbers from 1 to 1162 to determine which ones have a remainder equal to 0.

Remainder = N ( M × N M )

(where N M is the integer part of the quotient)

  • 1162 / 1 = 1162 (the remainder is 0, so 1 is a divisor of 1162)
  • 1162 / 2 = 581 (the remainder is 0, so 2 is a divisor of 1162)
  • 1162 / 3 = 387.33333333333 (the remainder is 1, so 3 is not a divisor of 1162)
  • ...
  • 1162 / 1161 = 1.0008613264427 (the remainder is 1, so 1161 is not a divisor of 1162)
  • 1162 / 1162 = 1 (the remainder is 0, so 1162 is a divisor of 1162)

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 1162 (i.e. 34.088121098119). Indeed, if a number N has a divisor D greater than its square root, then there is necessarily a smaller divisor d such that:

D × d = N

(thus, if N D = d , then N d = D )

  • 1162 / 1 = 1162 (the remainder is 0, so 1 and 1162 are divisors of 1162)
  • 1162 / 2 = 581 (the remainder is 0, so 2 and 581 are divisors of 1162)
  • 1162 / 3 = 387.33333333333 (the remainder is 1, so 3 is not a divisor of 1162)
  • ...
  • 1162 / 33 = 35.212121212121 (the remainder is 7, so 33 is not a divisor of 1162)
  • 1162 / 34 = 34.176470588235 (the remainder is 6, so 34 is not a divisor of 1162)