Compute negative indices