#include <bits/stdc++.h>
using namespace std;
int n;
    for (int i = 1; i <= n; ++i) {
        for (int j = i; (i + j + 2 * i * j) <= n; ++j) {
            marked[i + j + 2 * i * j] = true;
        }
    }

    if (limit >= 2) {
        cout << 2 << " ";
    }

    for (int p = 1; p <= n; ++p) {
        if (!marked[p]) {
            cout << (2 * p + 1) << " ";
        }
    }
    cout << endl;
}

int main() {
    int limit;
    cin >> limit;
    cout << "Prime numbers up to " << limit << " using Sieve of Sundaram:" << endl;
    sieveOfSundaram(limit);
    return 0;
}