You need to declare it as an array of integers. If you pass it in as data, it would like:
data {
int myindexes[6];
}
If you wanted to declare it in the model, it would look like:
transformed data {
int myindexes[6] = {8,20,33,45,60,55};
}
Also, when it comes to running your model, you don’t need to loop over the indexes in the array. Instead, you can just pass the entire array:
y[myindexes] ~ normal(mu, sigma);
Also notice above that I specified sigma, and not sigma2. This is because Stan parameterises the normal distribution using the standard deviation, not the variance.