#include #include using namespace std; bool checkPrime(int x){ for (int i = 3; (i*i) <= x; i+=2){ if (x%i == 0){ return false; } } return true; } int main(){ vectora[7]; // i think im allowed to have precomputed 1 digit primes right? a[0].push_back(2); a[0].push_back(3); a[0].push_back(5); a[0].push_back(7); cout << 7 << "\n"; for (int i = 1; i < 7; ++i){ for (int x = 0; x < a[i-1].size(); ++x){ for (int j = 1; j <= 9; j+=2){ int temp = a[i-1][x] * 10 + j; if (checkPrime(temp)){ a[i].push_back(temp); } } } cout << a[i][a[i].size() - 1] << "\n"; } }