#include<iostream>
#include<cstdio>
using namespace std;
int n,a[200005],b[200005];

int main(){
	cin>>n;
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=n;i>=1;i--){
		if (i*2>n) b[i]=a[i];
		else{
			int sum=0;
			for (int j=i+i;j<=n;j+=i) sum=(sum+b[j])%2;
			b[i]=sum^a[i];
		}
	}
	int tot=0;
	for(int i=1;i<=n;++i) tot+=b[i];
	cout<<tot<<endl;
	for(int i=1;i<=n;++i) if(b[i]) printf("%d ",i);
	return 0;
}
