Know nnei Find nearest power of 2 >= max nnei Find a good has function mapping numbers 1..N (say 1000) down to 1..nnei (say 57)