Generate N prime and generate all primes from N
void primeNum(int n) {
    bool* prime = new bool[n];
    for(int i=0; i<n; i++)
        prime[i] = true;

    for(int i=3; i<n; i++) {
        for(int j=2; j<i && prime[i]; j++) {
            if(prime[j] && (i % j) == 0)
                prime[i] = false;
        }
    }
    
    for(int i=2; i<n; i++) {
        std::cout<<"["<<i<<"]="<<prime[i]<<endl;
    }
    delete[] prime;
}

vector<int> primeList(int n){
    vector<int> vec;
    if(n > 1)
        vec.push_back(2);

    for(int j=3; j<=n; j++){
        bool isPrime = true;
        for(int i=0; i < vec.size() && isPrime; i++){
            if(j % vec[i] == 0)
                isPrime = false;
        }
        if(isPrime)
            vec.push_back(j);
    }
    return vec;
}

vector<int> geneNPrime(int n){
    vector<int> vec;
    if(n > 0)
        vec.push_back(2);

    int count = 1;
    int num = 3;
    while(count < n){
        bool isPrime = true;
        for(int i=0; i<vec.size() && isPrime; i++){
            if(num % vec[i] == 0)
                isPrime = false;
        }
        if(isPrime){
            vec.push_back(num);
            count++;
        }
        num++;
    }
    return vec;
}