#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  std::cin >> n;
  std::vector<int> v(n + 1);
  std::vector<int> ball(n + 1, 0);
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    std::cin >> v[i];
  }
  for (int i = n; i > 0; i--) {
    if (i > (n / 2)) {
      if (v[i] == 1) ball[i] = 1;
    } else {
      int sum = 0;
      for (int j = 2 * i; j <= n; j += i) {
        sum += ball[j];
      }
      sum %= 2;
      if (sum != v[i]) {
        ball[i]++;
        ans++;
      }
    }
  }
  std::cout << ans << '\n';
  for (int i = 1; i <= n; i++) {
    if (ball[i]) std::cout << i << '\n';
  }
  return 0;
}
