$d(n)$ is odd iff $n = k^2$

400 Views Asked by At

The function $d(n)$ gives the number of positive divisors of $n$, including $n$ itself. For example, $d(25) = 3$ because $25$ has three divisors: $1$, $5$, and $25$. Prove that $d(n)$ is odd if and only if $n$ is a perfect square. I need to prove this by proving that $d(n)$ is odd if and only if $n = k^2$ for some integer $k$.

1

There are 1 best solutions below

0
On

S'pose $n$ is not a square; then if $n = pq$, you know that $p$ and $q$ are different (can you explain why?). So divisors of $n$ come in pairs (any divisor $p$ is paired with $n/p$), hence there are an even number of them. Now see if you can do the other case.