Imports System.Collections.Generic
Public Class Program
  Shared Sub Main()
    Dim n As Integer = Integer.Parse(Console.ReadLine())
    Dim arrayA As Integer() = Array.ConvertAll(Of String, Integer)(Console.ReadLine().Split(" "), AddressOf Integer.Parse)
    Dim a As List(Of Integer) = New List(Of Integer)
    Dim b As List(Of Integer) = New List(Of Integer)
    For i As Integer = 0 To n - 1
      a.Add(arrayA(i))
      b.Add(0)
    Next
    Dim sum As Integer = 0
    Dim m As Integer = 0
    For i As Integer = n - 1 To 0 Step -1
      sum = 0
      For j As Integer = n \ (i + 1) To 2 Step -1
        sum += b(j * (i + 1) - 1)
      Next
      sum = sum Mod 2
      If sum = a(i) Then 
        b(i) = 0
      Else
        b(i) = 1
        m += 1
      End If
    Next
    Console.WriteLine(m.ToString())
    For i As Integer = 0 To n - 1
      If b(i) = 1 Then Console.Write((i + 1).ToString() & " ")
    Next
  End Sub
End Class