#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const ll inf = 1ll << 29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
  int N;
  cin >> N;
  vi a(N + 1);
  for (int i = 0; i < (N); i++) cin >> a.at(i + 1);
  vi b(N + 1);
  for (int i = N; i >= 1; --i) {
    int sum = 0;
    for (int j = i + i; j <= N; j += i) {
      sum ^= b.at(j);
    }
    b.at(i) = sum ^ a.at(i);
  }
  vi ans;
  for (int i = 1; i <= N; i++) {
    if (b.at(i)) ans.push_back(i);
  }
  cout << ans.size() << endl;
  for (int i = 0; i < (ans.size()); i++) {
    printf("%d%c", ans.at(i), i + 1 == ans.size() ? '\n' : ' ');
  }
  return 0;
}
