In the course ofdesigning a good hashing configuration,it is helpful to have a list of prime numbers forthehash table size.
The following is such alist. It has the properties that:
1. each number inthe list is prime
2. each number is slightlyless than twice the size of the previous
3. each number is as far aspossible from the nearest two powers of two
Using primes for hashtables is a good idea because it minimizes clustering in the hashed table. Item(2) is nice because it is convenient for growing a hash table in the face ofexpanding data. Item (3) has, allegedly, been shown to yield especially goodresults in practice.
And here is the list:
The columns are,in order, the lowerbounding power of two, the upper bounding power of two, the relative deviation(in percent)of the prime number from the optimal middle of the first two, and finally theprime itself.
Happy hashing!