n = gets.to_i
a = gets.chomp.split(" ").map(&:to_i)
wa = Array.new(n,0)
ans = []
n.downto(1) do |i|
  sum = 0
  j = 1
  while i * j <= n
    sum += wa[i*j-1]
    j += 1
  end
  if a[i-1] != sum % 2
    ans.push(i)
    wa[i-1] += 1
  end
end
puts ans.length
ans.reverse.each do |x|
  print "#{x} "
end
