#include<bits/stdc++.h>
#define M 200005
using namespace std;
int n,a[M],b[M];
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=n;i>=1;i--){
		int now=0;
		for(int j=i;j<=n;j+=i)now+=b[j];
		if(now%2!=a[i])b[i]=1;
		else b[i]=0;
	}
	int ans=0;
	for(int i=1;i<=n;i++)if(b[i])ans++;
	printf("%d\n",ans);
	for(int i=1;i<=n;i++)if(b[i])printf("%d ",i);
	return 0;
}