I don't know if it is intentional or not but you can make prime accept this by adding the range variable as a subscript to the b in the assignment:
NB: it only works for integer ranges.
I have also changed the 'ORIGIN' to 1 to match your range; If you don't do this the b will contain 0,4,5,6,7.
But it is a global assignment so it will affect every array defined.
If this is a problem & ORIGIN=0 is required, then you need to change b[a to b[a-1 (in this case)
Regards
Andy