import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



from functools import reduce

from operator import xor



N = int(readline())

A = [0] + list(map(int,read().split()))



B = [0] * (N+1)

for n in range(N,0,-1):

    s = reduce(xor,B[n+n::n],0)

    B[n] = s^A[n]



I = [i for i,x in enumerate(B) if x]



print((len(I)))

if len(I) > 0:

    print((' '.join(map(str,I))))
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



from functools import reduce

from operator import xor



N = int(readline())

A = [0] + list(map(int,read().split()))



for n in range(N//2,0,-1):

    A[n] = reduce(xor,A[n::n],0)



I = [i for i,x in enumerate(A) if x]



print((len(I)))

if len(I) > 0:

    print((' '.join(map(str,I))))
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from functools import reduce
from operator import xor

N = int(readline())
A = [0] + list(map(int, read().split()))
B = [0] * (N + 1)
for n in range(N, 0, -1):
    s = reduce(xor, B[n + n :: n], 0)
    B[n] = s ^ A[n]
I = [i for i, x in enumerate(B) if x]
print((len(I)))
if len(I) > 0:
    print((" ".join(map(str, I))))

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from functools import reduce
from operator import xor

N = int(readline())
A = [0] + list(map(int, read().split()))
for n in range(N // 2, 0, -1):
    A[n] = reduce(xor, A[n::n], 0)
I = [i for i, x in enumerate(A) if x]
print((len(I)))
if len(I) > 0:
    print((" ".join(map(str, I))))

-B = [0] * (N + 1) -for n in range(N, 0, -1): -    s = reduce(xor, B[n + n :: n], 0) -    B[n] = s ^ A[n] -I = [i for i, x in enumerate(B) if x] +for n in range(N // 2, 0, -1): +    A[n] = reduce(xor, A[n::n], 0) +I = [i for i, x in enumerate(A) if x]