/*
        _            _                  _            _       _     _         _   _          _          _             _        
       / /\         / /\               / /\         / /\    / /\  /\ \      /\_\/\_\ _     /\ \       /\ \     _    /\ \      
      / /  \       / /  \             / /  \       / / /   / / /  \ \ \    / / / / //\_\   \ \ \     /  \ \   /\_\ /  \ \     
     / / /\ \__   / / /\ \           / / /\ \__   / /_/   / / /   /\ \_\  /\ \/ \ \/ / /   /\ \_\   / /\ \ \_/ / // /\ \_\    
    / / /\ \___\ / / /\ \ \         / / /\ \___\ / /\ \__/ / /   / /\/_/ /  \____\__/ /   / /\/_/  / / /\ \___/ // / /\/_/    
    \ \ \ \/___// / /  \ \ \        \ \ \ \/___// /\ \___\/ /   / / /   / /\/________/   / / /    / / /  \/____// / / ______  
     \ \ \     / / /___/ /\ \        \ \ \     / / /\/___/ /   / / /   / / /\/_// / /   / / /    / / /    / / // / / /\_____\ 
 _    \ \ \   / / /_____/ /\ \   _    \ \ \   / / /   / / /   / / /   / / /    / / /   / / /    / / /    / / // / /  \/____ / 
/_/\__/ / /  / /_________/\ \ \ /_/\__/ / /  / / /   / / /___/ / /__ / / /    / / /___/ / /__  / / /    / / // / /_____/ / /  
\ \/___/ /  / / /_       __\ \_\\ \/___/ /  / / /   / / //\__\/_/___\\/_/    / / //\__\/_/___\/ / /    / / // / /______\/ /   
 \_____\/   \_\___\     /____/_/ \_____\/   \/_/    \/_/ \/_________/        \/_/ \/_________/\/_/     \/_/ \/___________/    
                                                                                                                              
*/
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for(int i = 0;i < (n);++i)

#define endl '\n'
#define pb push_back
#define mkp make_pair
#define p_q priority_queue
#define INF 200000000
#define PI 3.1415926
#define coutdb cout << fixed << setprecision(10)

const int dx[]={1,0,-1,0}, dy[]={0,-1,0,1};
const int dx_8[]={1,1,0,-1,-1,-1,0,1}, dy_8[]={0,-1,-1,-1,0,1,1,1};
const long long MOD = 1e9+7;

// typedef long long ll;
#define int long long

template <typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template <typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template <typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template <typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}

signed main(void){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N, a[200000]; cin >> N;
  vector<int> ans;
  REP(i, N) cin >> a[i];
  for(int i = N-1; i >= 0; i--){
    int num = i+1;
    if(i >= N/2 and a[i]==1){
      ans.pb(num);
      a[0]--;
      for(int j = 2; j*j <= num; j++){
        if(num % j == 0){
          a[j-1]--;
          if(j != num/j) a[num/j -1]--;
        }
      }
    }
    if(i < N/2 and i != 0){
      if(a[i] % 2 != 0){
        ans.pb(num);
        a[0]--;
        for(int j = 2; j*j <= num; j++){
          if(num % j == 0){
            a[j-1]--;
            if(j != num/j) a[num/j -1]--;
          }
        }
      }
    }
    if(i == 0){
      if(a[i] % 2 != 0){
        ans.pb(num);
      }
    }
  }
/*
  REP(i, N){
    if(i <= N/2 and a[i]==1){
      ans.pb(N-i);
      a[N-1]--;
      for(int j = 2; j*j <= i+1; j++){
        if((i+1) % j == 0){
          a[N-j]--;
          if(j != (i+1)/j) a[N - (i+1)/j]--;
        }
      }
    }
    if(i > N/2 and i != N-1){
      if(a[i] % 2 == 1){
        ans.pb(N-i);
        a[N-1]--;
        for(int j = 2; j*j <= i+1; j++){
          if((i+1) % j == 0){
            a[N-j]--;
            if(j != (i+1)/j) a[N - (i+1)/j]--;
          }
        }
      }
    }
    if(i == N-1){
      if(a[i] % 2 == 1){
        ans.pb(N-i);
      }
    }
  }*/
  cout << ans.size() << endl;
  REP(i, ans.size()) cout << ans[i] << ' ';
  cout << endl;
}

Measured memory_bytes: 3700