What are the divisors of 1071?

1, 3, 7, 9, 17, 21, 51, 63, 119, 153, 357, 1071

12 odd divisors

1, 3, 7, 9, 17, 21, 51, 63, 119, 153, 357, 1071

How to compute the divisors of 1071?

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 1071 by each of the numbers from 1 to 1071 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)

  • 1071 / 1 = 1071 (the remainder is 0, so 1 is a divisor of 1071)
  • 1071 / 2 = 535.5 (the remainder is 1, so 2 is not a divisor of 1071)
  • 1071 / 3 = 357 (the remainder is 0, so 3 is a divisor of 1071)
  • ...
  • 1071 / 1070 = 1.0009345794393 (the remainder is 1, so 1070 is not a divisor of 1071)
  • 1071 / 1071 = 1 (the remainder is 0, so 1071 is a divisor of 1071)

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 1071 (i.e. 32.726136343907). 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 )

  • 1071 / 1 = 1071 (the remainder is 0, so 1 and 1071 are divisors of 1071)
  • 1071 / 2 = 535.5 (the remainder is 1, so 2 is not a divisor of 1071)
  • 1071 / 3 = 357 (the remainder is 0, so 3 and 357 are divisors of 1071)
  • ...
  • 1071 / 31 = 34.548387096774 (the remainder is 17, so 31 is not a divisor of 1071)
  • 1071 / 32 = 33.46875 (the remainder is 15, so 32 is not a divisor of 1071)