n = gets.to_i
arr = gets.chomp.split(' ').map(&:to_i)
length = arr.length
answer = []
boxes = Array.new(length, 0)
arr.length.downto(1) do |i|
  sum = 0
  2.upto((length / i)) do |j|
    sum += boxes[(j * i) - 1]
  end
  judge = sum % 2 != arr[i - 1]
  boxes[i - 1] = judge ? 1 : 0
  if judge
    answer << i
  end
end

puts answer.length
puts answer.join(' ') if answer.length > 0
