updated to check uniform dist./ permutation of An achieved when multiplying by quadres of N