function main(input){
  input = input.split("\n");
  var n = parseInt(input[0]);

  var a = [];

  for (var i = 0; i < n; i++) {
    a[i] = parseInt(input[1].split(" ")[i]);
  }

  //console.log(a);


  var tama = [];
  var answer = [];
  var hanbun = Math.floor(n / 2);

// tamaは0が値なしになる
  for (var i = n; i > hanbun; i--){
    tama[i] = a[i-1];
    if (tama[i] == 1) {
      answer.push(i);
    }
  }

  for (var i = hanbun; i>0; i--){
    var hantei = a[i-1];
    for (var j = 2; i*j <= n; j++){
      hantei += tama[i*j];
    }
    tama[i] = hantei%2;
    if (tama[i] == 1) {
      answer.push(i);
    }
  }

//console.log(tama);
//console.log(answer);

console.log(answer.length);
for (var i = 0; i < answer.length; i++) {
  process.stdout.write(answer[i]+" ");
}



}
 
 
main(require('fs').readFileSync('/dev/stdin', 'utf8'));