Perfect squares, cubes and fifth powers $ \leq 10^8 $ I've the following question:

Find number of numbers $ \leq 10^8 $ which are neither perfect
  squares, nor perfect cubes nor perfect fifth powers.

What I currently have is:


*

*Number of perfect squares: $ n_1 = \sqrt[2]{10^8} = 10^4 $.

*Number of perfect cubes: $ n_2 = \text{floor}(\sqrt[3]{10^8}) = 464 $.

*Number of perfect squares: $ n_3 = \text{floor}(\sqrt[5]{10^8}) = 39 $.


Where floor(x) is the nearest integer $ \leq x $. But, how many numbers are there which are:


*

*perfect squares and perfect cubes (for eg. $64$)

*perfect squares and perfect fifth powers (for eg. $1024$)

*perfect cubes and perfect fifth powers? (for eg. $32768$)

 A: A number is a perfect square and a perfect cube if and only if it is a perfect sixth power. The number of positive perfect sixth powers $\le 10^8$ is $\lfloor (10^8)^{1/6}\rfloor$.
Similarly, the numbers that are perfect squares and perfect fifth powers are the perfect tenth powers. The number of these $\le 10^8$ is $(10^8)^{1/10}$.
We can similarly count the numbers that are simultaneously cubes and fifth powers. 
To find the number of numbers that are simultaneously squares, cubes, and fifth powers, note that these are the thirtieth powers, and there are $\lfloor(10^8)^{1/30}\rfloor$ of them from $1$ to $10^8$. That is not very interesting in this case, there is only one. 
To count the numbers in our interval that are neither squares nor cubes nor fifth powers, we use Inclusion/exclusion. 
Call a number bad if it is a perfect square, or perfect cube, or perfect fifth power. We want to count the number $b$ of bad numbers in our interval. Then the answer to our problem is $10^8-b$. 
If $A$ is the set of squares, and $B$ the set of cubes, and $C$ the set of fifth powers (all in the interval $1\le x\le 10^8$), then the number of bad numbers can be found by Inclusion/Exclusion. We have
$$b=|A\cup B\cup C|=|A|+|B|+|C|-|A\cap B|-|B\cap C|-|C\cap A|+|A\cap B\cap C|.$$
 we know how to compute all the numbers on the right.  
A: A positive integer $n$ is a perfect square iff the powers $a_k$ in its prime factorization $$n = p_1^{a_1} \cdots p_m^{a_m}$$ are all multiples of $2$. Likewise, $n$ is a perfect fifth power iff the powers $a_k$ are all multiple of $5$. So it is both iff the $a_k$ are all divisible by both $2$ and $5$, that is if they are all divisible by $10$. In the language of perfect powers, a number $n$ is a perfect square and a perfect fifth power iff it is a perfect $10$th power, and there are $\lfloor \sqrt[10]{10^8} \rfloor = 6$ of these in your interval.
More generally, the same reasoning shows that a positive integer $n$ is a perfect $r$th power and a perfect $s$th power iff it is a perfect $t$th power, where $t := \mathrm{lcm}(r, s)$.
