Sub topic 8
Perfect Squares and the Odd Number of Factors
Prerequisites and the key connection
Assume you can use integer multiplication, exponent notation, and basic factorization. In this chapter, a factor means a positive divisor unless stated otherwise. For example, the positive factors of 12 are \(1, 2, 3, 4, 6,\) and \(12\).
A positive integer has an odd number of positive factors exactly when it is a perfect square.
A perfect square is an integer that equals \(k^2\) for some integer \(k\). Examples include \(1, 4, 9, 16,\) and \(25\).
Why factors come in pairs
If \(d\) is a factor of \(n\), then \(n/d\) is also a factor. The two factors multiply to \(n\).
For \(36\), the pairs are:
- \(1 \cdot 36\)
- \(2 \cdot 18\)
- \(3 \cdot 12\)
- \(4 \cdot 9\)
- \(6 \cdot 6\)
Every pair has two different numbers except the middle pair, \(6 \cdot 6\). This happens because \(36=6^2\). The factor \(\sqrt{36}=6\) pairs with itself.
For a nonsquare such as 20, every factor pair has different members:
- \(1 \cdot 20\)
- \(2 \cdot 10\)
- \(4 \cdot 5\)
Thus, 20 has an even number of positive factors.
The theorem and its converse
For a positive integer \(n\):
- If \(n\) is not a perfect square, its factors form distinct pairs, so it has an even number of factors.
- If \(n\) is a perfect square, one factor pair is \(\sqrt n \cdot \sqrt n\), so there is one unpaired factor. The total number of factors is odd.
Therefore:
\[ n\text{ has an odd number of positive factors} \Longleftrightarrow n\text{ is a perfect square}. \]
The number 1 fits the rule. Its only positive factor is 1, so it has one factor, which is odd. Also, \(1=1^2\).
| Integer | Perfect square? | Positive factors | Number of factors |
|---|---|---|---|
| 20 | No | 1, 2, 4, 5, 10, 20 | 6 |
| 36 | Yes | 1, 2, 3, 4, 6, 9, 12, 18, 36 | 9 |
| 49 | Yes | 1, 7, 49 | 3 |
GRE applications
This theorem is useful when a question describes the number of factors without listing them. If \(x\) has exactly 15 positive factors, then \(x\) must be a perfect square because 15 is odd. If \(x\) is known not to be a perfect square, its number of positive factors must be even.
Use the theorem in quantitative comparison questions by checking whether the given information forces a number to be a square. Be careful: “factors” normally means positive factors in this setting. The number 0 is an exception to the usual finite factor-count discussion because every positive integer divides 0, so 0 has infinitely many positive factors.
from math import isqrt
def is_perfect_square(n):
root = isqrt(n)
return root * root == n
for number in [20, 36, 49]:
print(number, is_perfect_square(number))Exercise
A positive integer has exactly 21 positive factors. Must it be a perfect square?
Show answer
Yes. Twenty-one is odd, so the factor-pair theorem says the integer must be a perfect square.