Error on large RRR sequences

Positions on the array O are stored using 32 bits, which causes an overflow for large RRR sequences.
Solved using size_t (64 bits) variables.