Skip to content

Instantly share code, notes, and snippets.

@elaijuh
Forked from contivero/hashtable_sizes.c
Created November 3, 2024 15:42
Show Gist options
  • Save elaijuh/6cc88066af534b10f8e6fe66adf1fea2 to your computer and use it in GitHub Desktop.
Save elaijuh/6cc88066af534b10f8e6fe66adf1fea2 to your computer and use it in GitHub Desktop.
prime hashtable sizes
/* Values tested with haskell's isPrime function from the arithmoi-0.4.1.3 library */
unsigned long tablesize[] = { /* from highest 8-bit prime to highest 58-bit prime */
509, 1021, 2039, 4093, 8191, 16381, 32749, 65521, 131071, 262139, 524287,
1048573, 2097143, 4194301, 8388593 , 16777213 , 33554393 , 67108859 ,
134217689, 268435399, 536870909, 1073741789, 2147483647, 4294967291,
8589934583, 17179869143, 34359738337, 68719476731, 137438953447,
274877906899, 549755813881, 1099511627689, 2199023255531, 4398046511093,
8796093022151, 17592186044399, 35184372088777, 70368744177643,
140737488355213, 281474976710597, 562949953421231, 1125899906842597,
2251799813685119, 4503599627370449, 9007199254740881, 4503599627370449,
18014398509481951, 36028797018963913, 72057594037927931,
144115188075855859, 288230376151711717, 576460752303423433
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment