Why does taking floored root of a natural number x give me all natural numbers up to x which are perfect squares,cubes,fifths etc.

Eg. The number of perfect squares from $$1$$ to $$10^{10}$$ is $$\left(10^{10}\right)^{1/2}= 10^{5}$$

Context:I got this question from this one: Count the number of integers in the range $$1$$ to $$10^{10}$$ which are not perfect squares, cubes, or fifth powers. That is, the integer cannot be written in the form $$m^r$$ where $$m$$ is an integer and $$r$$ is one of $$2, 3, 5$$.

1 Answer

It’s pretty simple. Consider your example, which states that there are $$10^5$$ perfect squares in $$10^{10}$$. These perfect squares are the natural numbers from $$0$$ to $$10^5$$. $$10^5$$ squared is $$10^{10}$$ exactly, and since all the other members of the set are smaller, their squares will be less than $$10^{10}$$. Since the sequence of perfect squares is unchanging, all you need to do to find the number of perfect squares less than or equal to a number is to find the largest perfect square in that number, which will indeed be given by $$\left \lfloor{\sqrt x}\right \rfloor$$, or by $$\left \lceil{\sqrt[n]x}\right \rceil$$, for the number of perfect nths. Adding the perfect squares, cubes, and fifths together, you almost have the answer to your question. However, notice that there is still an extra step to the problem you provided: you need to subtract the intersection of the 3 sets. That should be relatively easy, as all three sets are all sequences of natural numbers of varying lengths.