#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int a[N + 1];
  int b[N + 1];
  vector<int> v;
  a[0] = 0;
  b[0] = 0;
  int count = 0;
  int tmp = 0;
  for (int i = 0; i < N; i++) {
    a[i + 1] = 0;
    b[i + 1] = 0;
    cin >> a[i + 1];
    if (i >= N / 2) {
      b[i + 1] = a[i + 1];
      if (b[i + 1] == 1) count++;
      v.push_back(i + 1);
    }
  }
  for (int i = N / 2; i > 0; i--) {
    int total = 0;
    int base = 2;
    while (base * i <= N) {
      total += b[base * i];
      base++;
    }
    b[i] = (total + a[i]) % 2;
    if (b[i] == 1) count++;
    v.push_back(i);
  }
  cout << count << endl;
  if (count > 0) {
    for (int i = 0; i < count; i++) {
      cout << v[i] << endl;
    }
  }
}
