you can make your Pari code even simpler other than to knock out the remaining multiples of five you can do:

Code:

forstep(x=1,10000,6,...)

or:

Code:

parfor(x=1,10000,...;if(x%5!=4,...))

for example.

because all the indexes that aren't even and don't divide by 3 are of form 6y+1 and then you can show they are 1,7,13,19,25 mod 30 and 25 mod 30 can always be taken away for the index because it will always end in 5.