If a number is a perfect square, it will have an odd number of factors (e.g., 4 has factors 1, 2, 4), whereas all other numbers have an even number of factors.
Is the converse true? Please explain why?
By converse, do you mean the following statement: "If a number has an odd number of factors, then it is a perfect square, and if a number has an even number of factors, then is it not a perfect square"? The original statement says that being a perfect square is equivalent to having an odd number of factors, so of course the converse is true.
Suppose that the number of factors of n is odd. We need to show that n is a perfect square. Suppose the contrary; then by the statement in post #1, n has an even number of factors, a contradiction.
In general, if you showed A implies B and (not A) implies (not B), then you showed that A and B are equivalent, so either one implies the other. Also, (not A) and (not B) are equivalent in this case.
So, I understand that the part in post #1 after "whereas" is not given.
Without loss of generality,for primes
. The number of factors of n is given by the divisor function
. If d(n) is odd, then all
's are even, so
.
Emakarov has given a first-rate proof, but I can't resist supplying a more basic proof that does not require knowledge of the properties of the divisor function.
Theorem: If n is not a square, then it has an even number of divisors.
Proof: Suppose x is a divisor of n, i.e. there is an integer y such that xy = n. Then y is also a divisor of n. (Here is the critical step.) Since n is not a square, x is not equal to y. So we have established a one-to-one correspondence between pairs of divisors of n, hence the number of divisors must be even.
Corollary (the contrapositive): If n has an odd number of divisors, then it is a square.