It looks like they are mapping 0 to 1, etc.
I'm not sure about the code which sets the first 2 numbers as not prime though, that would suggest 1 and 2 are not prime. I agree that 1 is not prime. I'm sure that 2 is prime though ;)
You could always use 101 length vectors and just ignore element 0, you would be less likely to make a silly error then.
I'm still advocating running through the algorithm on a piece of paper before starting coding (looks like it is a bit late for that now though)...