title: Why is the size 127 (prime) better than 128 for a hash-table?
body: <p>Supposing simple uniform hashing, that being, any given value is equally like to hash into any of the slots of the hash. Why is it better to use a table of size 127 and not 128? I really don't understand what's the problem with the power of 2 numbers. Or how it actually makes any difference at all.</p>
  
  <blockquote>
    <p>When  using  the  division  method, 
    we  usually  avoid  certain  values 
    of  m (table size). For example, m
    should not be a power of 2, since if m
    = 2^p  , then h(k) is just the p lowest-order bits of k.</p>
  </blockquote>
  
  <p>Let's suppose the possible elements are only between 1 and 10000 and I picked the table size as 128. How can 127 be better?
  So 128 is 2^6 (1000000) and 127 is 0111111. What difference does this make? All numbers (when hashed) are still going to be the p lowest-order bits of k for 127 too. Did I get something wrong?</p>
  
  <p>I'm looking for some examples as I really can't understand why is this bad. Thanks a lot in advance!</p>
  
  <p>PS: I am aware of:
  <a href="https://stackoverflow.com/questions/3980117/hash-table-why-size-should-be-prime">Hash table: why size should be prime?</a></p>