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 m As Integer = 0
    Dim b(0 To n - 1) As Integer
    For i As Integer = n To 1 Step -1
      b(i - 1) = arrayA(i - 1)
      For j As Integer = 2 To n 
        j = j * i
        If j < n Then b(i - 1) = (b(i - 1) + b(j)) Mod 2
      Next
      If b(i - 1) = 1 Then m += 1
    Next
    Console.WriteLine(m.ToString())
    If m <> 0 Then
      Dim output As String = ""
      For i As Integer = 1 To n
        If b(i - 1) = 1 Then
          If output <> "" Then output &= " "
          output &= i.ToString()
        End If
      Next
      Console.WriteLine(output)
    End If
  End Sub
End Class