console.log((args=>{
  const [[N],a] = args.trim().split('\n').map(r=>r.split(' ').map(v=>v|0));
  const b = [], c = Array(N).fill(0);
  for ( let i = N-1; i >= 0; i-- ) {
    let s = 0;
    for ( let j = i; j < N; j+=i+1 ) s ^= c[j];
    c[i] = s ^ a[i];
    if ( c[i] ) b.push(i+1);
  }
  return b.length + '\n' + b.join` `;
})(require('fs').readFileSync('/dev/stdin', 'utf8')));