Julia already has bounds checking at runtime on array access, so you could do the mod operation only if the bounds check fails.
But I don't get how this would practically work. Would each array have a preferred n that is used for the mod operation? For most situations where that makes sense, using a 2d array seems more logical.