Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If $n$ is an integer, how do you know whether $n^n$ is a perfect square, without a calculator?

The actual question is: "how many integers between $1$ and $100$ inclusive, raised to their own power, are perfect squares?".

share|cite|improve this question
up vote 14 down vote accepted

It is clear that if $n$ is an even number then, $n$ to power $n$ is surely a perfect square.

Now consider the case that n is an odd number. Let us do prime power factorization of n.

$$\text{so }n = a_1^{p_1} \times a_2^{p_2} \times a_3^{p_3} \cdots \times a_k^{p_k}$$.

Where, $a_1,a_2,\cdots,a_k$ are primes and $p_1,p_2,\cdots,p_k$ are maximum power of the corresponding prime present in $n$.


$$n^n = a_1^{p_1 \times n} \times a_2^{p_2 \times n} \times a_3^{p_3 \times n} \times a_k^{p_k \times n} $$

Now, we just have to use the fact that a number is a perfect square, iff all the powers in its prime-power-factorization are even numbers.

This suggests that all of $(p_1 \times n), (p_2 \times n), (p_3 \times n),\cdots, (p_k \times n)$ must be even to make $n^n$ a perfect square.

However, $n$ is an odd number as per our initial assumption. So it is clear that all of $p_1, p_2, p_3, \cdots, p_k$ must be even. (Since odd$ \times $odd cannot be even).

But $p_1,p_2,p_3,\cdots,p_k$ are the powers of prime-power-factorization of $n$. Since these are all even, it suggests that $n$ must also be a perfect square.

So, $n^n$ is a perfect square iff $n$ is even or $n$ itself is a perfect square.

For $n$ from $1$ to $100$ inclusive, there are $50$ even numbers. And $1, 9, 25, 49, 81$ are the five odd numbers which are perfect squares.

Hence, the answer is $55$.

share|cite|improve this answer
+1,neat explanation. I have introduced the latex formatting and changed the ambiguous $n$ to $k$ in the prime-factorization. Thanks. – Quixotic Dec 6 '11 at 18:37

Here are some hints:

1) Any number raised to any even (positive integer) power is a perfect square: $a^{2b} = (a^b)^2$.

2) Any perfect square raised to any (positive integer) power is a perfect square: $(a^2)^b = a^{2b} = (a^b)^2$.

3) The first two hints suggest that you should consider separately the cases in which $n$ is odd and $n$ is even.

share|cite|improve this answer

'$n^n$ is a perfect square' means that Square root of this number is a whole number. Let me solve this for both case of even and odd numbers as suggested by @pete:

If $n$ is an even number, then we may replace $n$ by $2m \ \forall m=1,2 \ldots$; and thus can write $n^n$ as ${(2m)}^{2m}$.Therefore, $\sqrt {{(2m)}^{2m}} = {(2m)}^m$ which is a whole number.

Similarly, if $n$ is odd, then we can adjust $n$ by $2m+1 \ \forall m=0,1,2 \ldots$; and $\sqrt{{(2m+1)}^{2m+1}} = {(2m+1)}^{m+\frac{1}{2}} ={(2m+1)}^m \times \sqrt{2m+1}$ which is a whole number iff $n=2m+1$ is already a perfect square.

share|cite|improve this answer
This seems to be slightly complicated way to repeating what @Pete L. Clark alluded. – Quixotic Dec 6 '11 at 13:21
When $n$ is odd, I fail to see why $n^m\sqrt{n}$ being a whole number implies that $n$ is a square. A priori, this only implies that $\sqrt{n}=k/n^m$ with $k$ integer, that is, that $\sqrt{n}$ is a rational number. An additional argument is needed to deduce from this that $\sqrt{n}$ is a whole number. This can be done, but is not yet. – Did Dec 6 '11 at 13:46
But we know that n is an integer. Doesn't this mean that $\sqrt n$ is either a whole number or irrational? For non-negative n at least. – Mike Dec 6 '11 at 15:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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