def pbox(n,a):
    count = 0
    result = []
    for i in xrange(n):
        total = 0
        b = [a[j] for j in xrange(i,n,i+1)]
        total = sum(b)
        if total % 2 == 1 and a[i] == 1:
            result.append(i+1)
        else:
            pass

    print len(result)
    print ' '.join(map(str,result))

if __name__ == '__main__':
    n = int(raw_input())
    a = map(int,raw_input().split())

    pbox(n,a)
~