n= int(input())

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

B = [0]*(n+1)

B_sum = [0]*(n+1)

count = 0



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



    j = 1

    while (n-i+1)*j <= n:

        B_sum[n-i+1] += B[(n-i+1)*j]

        j += 1

    if B_sum[n-i+1] % 2 != A[n-i]:

        B[n-i+1] = 1

        count += 1

print(count)

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

    

    if B[i]==1:

        print(str(i) + " ", end = "")













import sys

from collections import Counter, deque, defaultdict

from math import factorial

import heapq, bisect

import math

import itertools

sys.setrecursionlimit(10 ** 5 + 10)

def input(): return sys.stdin.readline().strip()

def INT(): return int(input())

def MAP(): return map(int, input().split())

def LIST(): return list(map(int, input().split()))



n = INT()

A = LIST()

ans = [0]*n

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

    res = 0

    j = 0

    while (j+1) *(i+1) <= n:

        res += ans[(j+1)*(i+1)-1]

        j += 1

    if res%2 != A[i]:

        ans[i] = 1

print(ans.count(1))

for i in range(n):

    if ans[i] == 1:

        print(str(i+1)+' ', end = '')

    

n = int(input())
A = list(map(int, input().split()))
B = [0] * (n + 1)
B_sum = [0] * (n + 1)
count = 0
for i in range(1, n + 1):
    j = 1
    while (n - i + 1) * j <= n:
        B_sum[n - i + 1] += B[(n - i + 1) * j]
        j += 1
    if B_sum[n - i + 1] % 2 != A[n - i]:
        B[n - i + 1] = 1
        count += 1
print(count)
for i in range(1, n + 1):
    if B[i] == 1:
        print(str(i) + " ", end="")

import sys
from collections import Counter, deque, defaultdict
from math import factorial
import heapq, bisect
import math
import itertools

sys.setrecursionlimit(10**5 + 10)


def input():
    return sys.stdin.readline().strip()


def INT():
    return int(input())


def MAP():
    return map(int, input().split())


def LIST():
    return list(map(int, input().split()))


n = INT()
A = LIST()
ans = [0] * n
for i in range(n - 1, -1, -1):
    res = 0
    j = 0
    while (j + 1) * (i + 1) <= n:
        res += ans[(j + 1) * (i + 1) - 1]
        j += 1
    if res % 2 != A[i]:
        ans[i] = 1
print(ans.count(1))
for i in range(n):
    if ans[i] == 1:
        print(str(i + 1) + " ", end="")

-n = int(input()) -A = list(map(int, input().split())) -B = [0] * (n + 1) -B_sum = [0] * (n + 1) -count = 0 -for i in range(1, n + 1): -    j = 1 -    while (n - i + 1) * j <= n: -        B_sum[n - i + 1] += B[(n - i + 1) * j] +import sys +from collections import Counter, deque, defaultdict +from math import factorial +import heapq, bisect +import math +import itertools + +sys.setrecursionlimit(10**5 + 10) + + +def input(): +    return sys.stdin.readline().strip() + + +def INT(): +    return int(input()) + + +def MAP(): +    return map(int, input().split()) + + +def LIST(): +    return list(map(int, input().split())) + + +n = INT() +A = LIST() +ans = [0] * n +for i in range(n - 1, -1, -1): +    res = 0 +    j = 0 +    while (j + 1) * (i + 1) <= n: +        res += ans[(j + 1) * (i + 1) - 1] -    if B_sum[n - i + 1] % 2 != A[n - i]: -        B[n - i + 1] = 1 -        count += 1 -print(count) -for i in range(1, n + 1): -    if B[i] == 1: -        print(str(i) + " ", end="") +    if res % 2 != A[i]: +        ans[i] = 1 +print(ans.count(1)) +for i in range(n): +    if ans[i] == 1: +        print(str(i + 1) + " ", end="")