A colleague of mine mentioned that there was something special about the number nine. He noticed that nine had three positive integer divisors {1, 3, 9} and the square root of nine is three.

His question was: Are there any other positive integers n, such that the number of positive integer divisors of n is equal to the square root of n?


2 Answers 2


Yes, $1$ has positive integer divisor $\{1\}$, and $|\{1\}|=1=\sqrt{1}$.

  • $\begingroup$ Yes, one works! Any more numbers with the given property? $\endgroup$ Jul 20, 2022 at 21:27
  • $\begingroup$ Almost sure 1 and 3 are the only solutions. Type Length[Divisors[n^2]]-n, n=1...1000 into Wolfram Alpha, only 1st and 3rd equal zero and after 30 seems no possibility to achieve it again. wolframalpha.com/… $\endgroup$
    – z100
    Jul 20, 2022 at 21:55

The number of positive divisors is a multiplicative function in the number theoretical sense. The square root is also multiplicative. We can therefore proceed prime factor by prime factor. If p occurs in n 2k times (an even number because n is a perfect square) then this contributes a factor of p^k to the square root and a factor of 2k+1 to the divisor count function. This rules out p=2. But for anything other than p=3,k=1 p^k will be greater than 2k+1. This leaves 1 and 9 as the only possible solutions.

  • 4
    $\begingroup$ This should be the accepted answer. $\endgroup$
    – RobPratt
    Jul 21, 2022 at 13:08
  • 2
    $\begingroup$ @RobPratt I debated whether I should have accepted your answer or Loopy’s. Loopy’s answer is more thorough than yours but I eventually decided to accept yours because 1) your answer was posted first AND 2) your answer technically answers my question the way I wrote it AND 3) I found your answer concise and easier to understand. $\endgroup$ Jul 21, 2022 at 19:24
  • $\begingroup$ OK, thanks @WillOctagonGibson! $\endgroup$
    – RobPratt
    Jul 21, 2022 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.