#import <Foundation/Foundation.h>
typedef long long Int;
int main() {
	@autoreleasepool{
		Int N;
		scanf("%lld",&N);
		Int *A = (Int*)malloc((N+1)*sizeof(Int));
		Int *X = (Int*)malloc((N+1)*sizeof(Int));
		for(Int i=1;i<=N;i++){
			scanf("%lld",A+i);
		}
		NSMutableArray *answers = [NSMutableArray array];
		for(Int i=N;i>=1;i--){
			X[i] = A[i];
			for(Int j=2;i*j<=N;j++){
				X[i] -= X[i*j];
			}
			X[i] %= 2;
			if(X[i]==1) [answers addObject:@(i)];
		}
		printf("%lu\n",[answers count]);
		puts([answers componentsJoinedByString:@" "].UTF8String);
	}
}