/*
ID: thanhvq1
LANG: C++14
PROB: namenum
*/

#pragma GCC optimize ("O2")
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;

// defines
#define int long long
typedef long long ll;
#define double long double
#define vec vector
#define vi vector<int>
#define vvi vector<vector<int>>
#define FZ(n) memset((n),0,sizeof())
#define FMO(n) memset((n),-1,sizeof(n))
#define unset unordered_set
#define ii pair<int, int>
#define vii vector<ii>
#define F first;
#define S second
#define mp make_pair
#define PB push_back
#define ALL(x) begin(x),end(x)
#define SZ(x) ((int)(x).size())
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORE(i, a, b) for(int i = (a); i <= (b); i++)
#define FORD(i, a, b) for(int i = (a); i >= (b); i--)
#define bitcount(n) __builtin_popcountll(n)
#define reset(x, y) memset(x, y, sizeof(x))
#define uni(x) (x).erase(unique(all(x)), (x).end());
#define BUG(x) cerr << #x << " = " << (x) << endl
#define chkmin(a, b) a = min(a, b)
#define chkmax(a, b) a = max(a, b)
#define max3(a, b, c) max(a, b) > max(b, c) ? max(a, b) : max(b, c)
#define min3(a, b, c) min(a, b) < min(b, c) ? min(a, b) : min(b, c)

//permanent constants
const long long ZERO = 0LL;
const long long INF64 = 1e18;
const int INF32 = 1e9;
const int MOD = 998244353; //1e9 + 7;  const ll MOD2 = (ll)MOD * (ll)MOD;
const double PI = 2.0*acos(0.0); //acos(-1.0L);
const double EPS = static_cast<double>(1e-10);
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int dx[4] = {0, 1, 0, -1}; const int dy[4] = {1, 0, -1, 0};
//const ll INF = (ll)(1e18 + 239);
const int BIG = (int)(1e9 + 239);

//random
mt19937 rnd(239); //(chrono::high_resolution_clock::now().time_since_epoch().count());

void FILEIO() {  freopen("in.txt", "r", stdin);  freopen("out.txt", "w", stdout); }
//void FILEIO() {  freopen("namenum.in", "r", stdin);  freopen("namenum.out", "w", stdout); }
void input() {   }

vi getDivisors(int n) {// return the divisors
	vi ans;
    for (int i=1; i*i <=n; ++i) {
        if (n%i == 0) {
        	ans.PB(i); // If divisors are equal, take only one
            if (i*i != n)  ans.PB(n/i);
        }
    }
    return ans;
}

//void test() {
//	while(1) {
//		int n; cin >> n;
//		vi div = getDivisors(n);
//		FOR(i, 0, SZ(div)) cout << div[i] << ",";
//		cout << endl;
//	}
//}
vi a, sum, box;
//void show(vi & name) {
//	FORE(i, 1, SZ(name)-1) cout << name[i] << " ";
//	cout << endl;
////	FORE(i, 1, SZ(a)) cout << sum[i] << " ";
////	cout << endl;
////	FORE(i, 1, SZ(a)) cout << box[i] << " ";
////	cout << endl;
//}

void solve() {
	int n; cin >> n;
	a.resize(n+1); FORE(i,1, n) cin >> a[i];
	sum.resize(n+1); FORE(i, 1, n) sum[i]=0; // sum[i] = sum of all numbers a[j]: j%i==0, i=1, ...n
	box.resize(n+1);
	FORD(i, n, 1) {

//		show(a); show(sum);show(box);

		box[i] = (a[i] + sum[i])%2;

//		cout << "box: "; show(box);

		if(box[i]==1) {
			vi div = getDivisors(i);
			FOR(j, 0, SZ(div)) {
				sum[div[j]] = (sum[div[j]]+box[i])%2;
			}
		}

//		cout << "sum: "; show(sum);

	}
	int cnt=0; FORE(i, 1, n) if(box[i]!=0) cnt++;
	cout << cnt << endl;
	FORE(i, 1, n) if(box[i]==1) cout << i << " ";
	cout << endl;
}

signed main() {
  ios_base::sync_with_stdio(false); cin.tie();
//  FILEIO();
//auto beginProgram = chrono::steady_clock::now();

//  test();

//  int test = 0;
//  string s; getline(cin, s); int t = stoi(s);
//  while(t--)
  {
//	  cout << "Case " << ++test << ": ";
	  solve();
  }

  //auto endProgram = chrono::steady_clock::now();

  return 0;
}


Measured memory_bytes: 5632