âšī¸ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.1 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://planetmath.org/goodhashtableprimes |
| Last Crawled | 2026-04-13 05:34:41 (2 days ago) |
| First Indexed | 2018-09-05 04:54:10 (7 years ago) |
| HTTP Status Code | 200 |
| Meta Title | good hash table primes |
| Meta Description | null |
| Meta Canonical | null |
| Boilerpipe Text | In the course of designing a good
hashing
configuration
, it is helpful to have a list of prime numbers for the
hash table
size.
The following is such a list. It has the properties that:
1.
each number in the list is prime
2.
each number is slightly less than twice the size of the previous
3.
each number is as far as possible from the nearest two
powers of two
Using primes for hash tables 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 of expanding data. Item (3) has, allegedly, been shown to yield especially good results in practice.
And here is the list:
The columns are, in order, the lower bounding 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 the prime itself.
Happy hashing! |
| Markdown | # good hash table primes
In the course of designing a good [hashing](http://planetmath.org/hashing) [configuration]()[](http://mathworld.wolfram.com/Configuration.html)[](http://planetmath.org/automaton)[](http://planetmath.org/unlimitedregistermachine), it is helpful to have a list of prime numbers for the [hash table](http://mathworld.wolfram.com/HashTable.html) size.
The following is such a list. It has the properties that:
1. 1\.
each number in the list is prime
2. 2\.
each number is slightly less than twice the size of the previous
3. 3\.
each number is as far as possible from the nearest two [powers of two](http://planetmath.org/poweroftwo)
Using primes for hash tables 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 of expanding data. Item (3) has, allegedly, been shown to yield especially good results in practice.
And here is the list:
| lwr | upr | % err | prime |
|---|---|---|---|
| 25 2 5 | 26 2 6 | 10\.416667 | 53 |
| 26 2 6 | 27 2 7 | 1\.041667 | 97 |
| 27 2 7 | 28 2 8 | 0\.520833 | 193 |
| 28 2 8 | 29 2 9 | 1\.302083 | 389 |
| 29 2 9 | 210 2 10 | 0\.130208 | 769 |
| 210 2 10 | 211 2 11 | 0\.455729 | 1543 |
| 211 2 11 | 212 2 12 | 0\.227865 | 3079 |
| 212 2 12 | 213 2 13 | 0\.113932 | 6151 |
| 213 2 13 | 214 2 14 | 0\.008138 | 12289 |
| 214 2 14 | 215 2 15 | 0\.069173 | 24593 |
| 215 2 15 | 216 2 16 | 0\.010173 | 49157 |
| 216 2 16 | 217 2 17 | 0\.013224 | 98317 |
| 217 2 17 | 218 2 18 | 0\.002543 | 196613 |
| 218 2 18 | 219 2 19 | 0\.006358 | 393241 |
| 219 2 19 | 220 2 20 | 0\.000127 | 786433 |
| 220 2 20 | 221 2 21 | 0\.000318 | 1572869 |
| 221 2 21 | 222 2 22 | 0\.000350 | 3145739 |
| 222 2 22 | 223 2 23 | 0\.000207 | 6291469 |
| 223 2 23 | 224 2 24 | 0\.000040 | 12582917 |
| 224 2 24 | 225 2 25 | 0\.000075 | 25165843 |
| 225 2 25 | 226 2 26 | 0\.000010 | 50331653 |
| 226 2 26 | 227 2 27 | 0\.000023 | 100663319 |
| 227 2 27 | 228 2 28 | 0\.000009 | 201326611 |
| 228 2 28 | 229 2 29 | 0\.000001 | 402653189 |
| 229 2 29 | 230 2 30 | 0\.000011 | 805306457 |
| 230 2 30 | 231 2 31 | 0\.000000 | 1610612741 |
The columns are, in order, the lower bounding power of two, the upper bounding power of two, the relative deviation (in percent) of the [prime number]()[](http://mathworld.wolfram.com/PrimeNumber.html)[](http://planetmath.org/prime) from the optimal middle of the first two, and finally the prime itself.
Happy hashing\!
| | |
|---|---|
| Title | [good hash table primes](http://planetmath.org/goodhashtableprimes) |
| Canonical name | GoodHashTablePrimes |
| Date of creation | 2013-03-22 12:57:37 |
| Last modified on | 2013-03-22 12:57:37 |
| Owner | akrowne (2) |
| Last modified by | akrowne (2) |
| Numerical id | 10 |
| Author | akrowne (2) |
| Entry type | Result |
| [Classification](http://mathworld.wolfram.com/Classification.html) | msc 68P05 |
| Classification | msc 68P10 |
| Classification | msc 68P20 |
Generated on Sat Feb 10 12:37:49 2018 by [LaTeXML ![\[LOGO\]](data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9wKExQZLWTEaOUAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAdpJREFUKM9tkL+L2nAARz9fPZNCKFapUn8kyI0e4iRHSR1Kb8ng0lJw6FYHFwv2LwhOpcWxTjeUunYqOmqd6hEoRDhtDWdA8ApRYsSUCDHNt5ul13vz4w0vWCgUnnEc975arX6ORqN3VqtVZbfbTQC4uEHANM3jSqXymFI6yWazP2KxWAXAL9zCUa1Wy2tXVxheKA9YNoR8Pt+aTqe4FVVVvz05O6MBhqUIBGk8Hn8HAOVy+T+XLJfLS4ZhTiRJgqIoVBRFIoric47jPnmeB1mW/9rr9ZpSSn3Lsmir1fJZlqWlUonKsvwWwD8ymc/nXwVBeLjf7xEKhdBut9Hr9WgmkyGEkJwsy5eHG5vN5g0AKIoCAEgkEkin0wQAfN9/cXPdheu6P33fBwB4ngcAcByHJpPJl+fn54mD3Gg0NrquXxeLRQAAwzAYj8cwTZPwPH9/sVg8PXweDAauqqr2cDjEer1GJBLBZDJBs9mE4zjwfZ85lAGg2+06hmGgXq+j3+/DsixYlgVN03a9Xu8jgCNCyIegIAgx13Vfd7vdu+FweG8YRkjXdWy329+dTgeSJD3ieZ7RNO0VAXAPwDEAO5VKndi2fWrb9jWl9Esul6PZbDY9Go1OZ7PZ9z/lyuD3OozU2wAAAABJRU5ErkJggg==)](http://dlmf.nist.gov/LaTeXML/) |
| Readable Markdown | null |
| Shard | 47 (laksa) |
| Root Hash | 10053059813130500247 |
| Unparsed URL | org,planetmath!/goodhashtableprimes s443 |