[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: question on hash for objects such as tables and functions
- From: Francisco Olarte <folarte@...>
- Date: Tue, 26 May 2020 20:47:01 +0200
Philippe:
On Tue, May 26, 2020 at 3:26 AM Philippe Verdy <verdyp@gmail.com> wrote:
> Note that not all Mersenne numbers 2^p-1 are primes (even if they are not powers of 2, nor multiples of power of 2, like aligned addresses)
...
> For example 2^16-1 is a multiple of 5, so addresses that are 5 times the alignment size for addresses will collide frequently in a table with 2^16 nodes.
You do not have to go this long, 2^4 -1 is 3*5
It's a well known thing that p must be prime for 2^p-1 to be prime (
necessary, not sufficient ).
I think it was in the 1st course of bachillerato ( 14 years old ),
where we learnt the x^n -1 = (x-1)*(x^(n-1)+x^(n-2)+....+1), in this
case, if p == m*n , both greter than 1, then
2^p -1 = (2^m)^p -1 = (2^m-1)*.(... this is too long to type, but > 1 if n>1)
Francisco Olarte.