n = gets.to_i
array = gets.split(" ").map(&:to_i)
result = Array.new(n, 0)
count = 0

n.downto(1) do |i|
  multiple_count = n / i

  sum = 0
  if multiple_count > 1
    multiple_count.downto(2) do |j|
      sum += result[i * j - 1]
    end
  end

  unless array[i - 1] == sum % 2
    result[i - 1] = 1
    count += 1
  end
end

puts count

result.each.with_index do |re, i|
  print "#{i + 1} " if re == 1
end