n = gets.to_i
a = gets.chomp.split.map(&:to_i)
a.unshift(0)
res = Hash.new(0)

n.step(1, - 1) do |i|
  if i <= n / 2
    a[i] = ((1..(n / i)).inject(0) {|acc, j| acc + a[j * i] }) % 2
  end

  if a[i] != 0
    res[i] = a[i]
  end
end

puts res.keys.size
puts res.keys.join(" ")
