# 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



def main():

    N = int(input())



    a = [0]

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



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

        a[x] = sum(a[x::x]) & 1



    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
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
def main():
    N = int(input())
    a = [0]
    a += map(int, input().split())
    for x in reversed(range(1, N // 2 + 1)):
        a[x] = sum(a[x::x]) & 1
    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

-    from functools import reduce -    from operator import xor - -        a[x] = reduce(xor, a[x::x]) +        a[x] = sum(a[x::x]) & 1