def div(val):

  ret=[]

  for i in range(1,int(val**0.5)+1):

    if val%i==0:

      ret.append(i)

      if val//i!=i:

        ret.append(val//i)

  return ret



n=int(eval(input()))

arr=list(map(int,input().split()))

cnt=[0]*n

num=0

ans=[]

for i in range(n-1,-1,-1):

  if (arr[i]+cnt[i])%2==0:

    continue

  else:

    ans.append(i+1)

    num+=1

    for j in div(i+1):

      cnt[j-1]+=1

if num==0:

  print((0))

else:

  print(num)

  print((*ans))
n=int(eval(input()))

arr=list(map(int,input().split()))

flag=[-1]*n

ans=[]

for i in range(n-1,-1,-1):

  cnt=0

  for j in range(i,n,i+1):

    if j==i:

      continue

    else:

      if flag[j]==1:

        cnt+=1

  if (arr[i]+cnt)%2==0:

    flag[i]=0

  else:

    flag[i]=1

    ans.append(i+1)

num=len(ans)

if num==0:

  print((0))

else:

  print(num)

  print((*ans))
def div(val):
    ret = []
    for i in range(1, int(val**0.5) + 1):
        if val % i == 0:
            ret.append(i)
            if val // i != i:
                ret.append(val // i)
    return ret


n = int(eval(input()))
arr = list(map(int, input().split()))
cnt = [0] * n
num = 0
ans = []
for i in range(n - 1, -1, -1):
    if (arr[i] + cnt[i]) % 2 == 0:
        continue
    else:
        ans.append(i + 1)
        num += 1
        for j in div(i + 1):
            cnt[j - 1] += 1
if num == 0:
    print((0))
else:
    print(num)
    print((*ans))

n = int(eval(input()))
arr = list(map(int, input().split()))
flag = [-1] * n
ans = []
for i in range(n - 1, -1, -1):
    cnt = 0
    for j in range(i, n, i + 1):
        if j == i:
            continue
        else:
            if flag[j] == 1:
                cnt += 1
    if (arr[i] + cnt) % 2 == 0:
        flag[i] = 0
    else:
        flag[i] = 1
        ans.append(i + 1)
num = len(ans)
if num == 0:
    print((0))
else:
    print(num)
    print((*ans))

-def div(val): -    ret = [] -    for i in range(1, int(val**0.5) + 1): -        if val % i == 0: -            ret.append(i) -            if val // i != i: -                ret.append(val // i) -    return ret - - -cnt = [0] * n -num = 0 +flag = [-1] * n -    if (arr[i] + cnt[i]) % 2 == 0: -        continue +    cnt = 0 +    for j in range(i, n, i + 1): +        if j == i: +            continue +        else: +            if flag[j] == 1: +                cnt += 1 +    if (arr[i] + cnt) % 2 == 0: +        flag[i] = 0 +        flag[i] = 1 -        num += 1 -        for j in div(i + 1): -            cnt[j - 1] += 1 +num = len(ans)