N = int(input())
arg = list(map(int, input().split()))
x = [0]*N

for i in range(N, N//2, -1):
  if arg[i-1] == 0:
    x[i-1] = 0
  else:
    x[i-1] = 1

for i in range(N//2, 0, -1):
  others = 0
  for j in range(N, i, -1):
    if j % i == 0:
      others += arg[j-1]
  if arg[i-1] % 2 != others % 2:
    x[i-1] = 1
  else:
    x[i-1] = 0
    
ans = []
if max(x) == 0:
  print(0)
else:
  for index in range(len(x)):
    if x[index] != 0:
      ans.append(index+1)
  print(len(ans))
  print(*ans)