def main():

    N = int(input())



    a = [0]

    a += map(int, input().split())



    b = [0] * (N + 1)



    x = N

    k = 1

    while x > 0:

        while x * (k + 1) > N:

            t = 0

            for j in range(2, k + 1):

                t ^= b[x * j]

            b[x] = a[x] ^ t

            x -= 1

        k += 1



    ans = [i for i, x in enumerate(b) if x == 1]

    print(len(ans))

    print(*ans, sep='\n')





if __name__ == '__main__':

    main()



# import sys

# input = sys.stdin.readline

# 

# sys.setrecursionlimit(10 ** 7)

# 

# (int(x)-1 for x in input().split())

# rstrip()

#

# def binary_search(*, ok, ng, func):

#     while abs(ok - ng) > 1:

#         mid = (ok + ng) // 2

#         if func(mid):

#             ok = mid

#         else:

#             ng = mid

#     return ok

# https://atcoder.jp/contests/abc134/submissions/7469219



def main():

    from functools import reduce

    from operator import xor



    N = int(input())



    a = [0]

    a += map(int, input().split())



    for x in reversed(range(1, N // 2 + 1)):

        a[x] = reduce(xor, a[x::x])



    ans = [i for i, x in enumerate(a) if x]

    print(len(ans))

    print(*ans, sep='\n')





if __name__ == '__main__':

    main()



# import sys

# input = sys.stdin.readline

#

# sys.setrecursionlimit(10 ** 7)

#

# (int(x)-1 for x in input().split())

# rstrip()

#

# def binary_search(*, ok, ng, func):

#     while abs(ok - ng) > 1:

#         mid = (ok + ng) // 2

#         if func(mid):

#             ok = mid

#         else:

#             ng = mid

#     return ok

def main():
    N = int(input())
    a = [0]
    a += map(int, input().split())
    b = [0] * (N + 1)
    x = N
    k = 1
    while x > 0:
        while x * (k + 1) > N:
            t = 0
            for j in range(2, k + 1):
                t ^= b[x * j]
            b[x] = a[x] ^ t
            x -= 1
        k += 1
    ans = [i for i, x in enumerate(b) if x == 1]
    print(len(ans))
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()
# import sys
# input = sys.stdin.readline
#
# sys.setrecursionlimit(10 ** 7)
#
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

# https://atcoder.jp/contests/abc134/submissions/7469219
def main():
    from functools import reduce
    from operator import xor

    N = int(input())
    a = [0]
    a += map(int, input().split())
    for x in reversed(range(1, N // 2 + 1)):
        a[x] = reduce(xor, a[x::x])
    ans = [i for i, x in enumerate(a) if x]
    print(len(ans))
    print(*ans, sep="\n")


if __name__ == "__main__":
    main()
# import sys
# input = sys.stdin.readline
#
# sys.setrecursionlimit(10 ** 7)
#
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok

+# https://atcoder.jp/contests/abc134/submissions/7469219 +    from functools import reduce +    from operator import xor + -    b = [0] * (N + 1) -    x = N -    k = 1 -    while x > 0: -        while x * (k + 1) > N: -            t = 0 -            for j in range(2, k + 1): -                t ^= b[x * j] -            b[x] = a[x] ^ t -            x -= 1 -        k += 1 -    ans = [i for i, x in enumerate(b) if x == 1] +    for x in reversed(range(1, N // 2 + 1)): +        a[x] = reduce(xor, a[x::x]) +    ans = [i for i, x in enumerate(a) if x]