#include <iostream>
using namespace std;

int main() 
{
  int n;
  cin >> n;
  int a[n], b[n];
  int c[n] = {};
  for (int i = 0; i < n; ++i) cin >> a[i];
  
  int l = 1;
  while (l <= n) {
    for (int i = n/l - 1; i > n/(l+1) - 1; --i) {
      for (int j = 2; j <= l; ++j) {
        c[i] += b[(i+1) * j - 1];
      }
      b[i] = a[i] ^ (c[i] % 2);
    }
    ++l;
  }
  
  int count = 0;
  for (int i = 0; i < n; ++i) {
    count += b[i];
  }
  cout << count << endl;
  for (int i = 0; i < n; ++i) {
    if (b[i] == 1) {
      cout << i + 1 << " " ;
    }
  }
  return 0;
}