if n > 1000:
    print('n is too large to run the check')
else:
    c = a[:] + b[:, (np.newaxis)]
c = c.ravel()
c = c % N
result2 = np.bincount(c)
pv(result2)
assert all(r1 == r2 for r1, r2 in zip(result, result2))
Numpy, problem with long arrays