Let's define to be the number of numbers less than or equal to such that they are neither the perfect squares or cubes.

We then have .

The intuition behind is we take every number up to and then subtract all of the perfect squares and cubes. We must then account for any duplicates.

Now solve .