2,3,5,6,7,10,11 Counting with Restrictions The sequence 2, 3, 5, 6, 7, 10, 11, $\ldots$ contains all the positive integers from least to greatest that are neither squares nor cubes nor perfect fifth powers (in the form of $x^{5}$, where $x$ is an integer). What is the $1000^{\mathrm{th}}$ term of the sequence?
I've seen problems where I need to count with restrictions (like cubes and squares). I have never seen a problem with this degree.  Here is my thought process. 
Find intersection of squares and cubes. This is simple enough. For every 6th square, there will lie a cube. We can do this for everything else (intersection of 2 and 4, 2 and 5, 3 and 4, 3 and 5), but it will be tedious. Now, count out the numbers. This solution is very tedious...Can someone guide me through the solution?

Let $B(n)$ be the number of integers in range $\{1,2,\dots, n\}$ that are not squares cubes or fifth powers.
We want to find the first number such that $B(n)=1000$.
A formula for $B(n)$ can be obtained with inclusion exclusion.
We get $B(n)=n- \lfloor \sqrt{n} \rfloor- \lfloor\sqrt[3]{n} \rfloor- \lfloor\sqrt[5]{n} \rfloor + \lfloor\sqrt[6]{n}\rfloor + \lfloor\sqrt[10]{n}\rfloor + \lfloor\sqrt[15]{n}\rfloor - \lfloor\sqrt[30]{n}\rfloor $
This is very close to $n$.
Proposed method:
Take $N_0=1000$ and take $N_{i+1}=N_i+(1000-B(N_i))$. Notice this guarantees $B(N_{i-1})<1000$
The method in action:
$N_0=1000\implies B(N_0)=1000-31-10-3+3+1+1-1=1000-40$
$N_1=1040\implies B(N_1)=1040-32-10-4+3+2+1-1=999$
$N_2=1041\implies B(N_1)=1041-32-10-4+3+2+1-1=1000$
we are done. $1041$ is the answer.

verification code in c++:
#include <bits/stdc++.h>
using namespace std;


int pot(int a, int p){
    int res=1;
    while(p){
        if(p%2) res*=a;
        a=a*a;
        p/=2;
    }
    return(res);
}

int ispow(int a, int p){
    for(int i=1;pot(i,p) <= a; i++){
        if(pot(i,p)== a) return(1);
    }
    return(0);
}

int main(){
    int count=0;
    for(int i=1; ;i++){
        int add=1;
        for(int j=2;j<=5;j++){
            if(ispow(i,j)){
                add=0;
                break;
            }
        }
        count +=add;
        if(count == 1000){
            printf("%d\n",i);
            return(0);
        }
    }
}

