lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Le mer. 27 mai 2020 à 18:05, Francisco Olarte <folarte@peoplecall.com> a écrit :
Can I see some place where 2^n+1 is called a Mersenne Number?

It does not matter how Mersenne is restrively or inclusively defined (I've already stated that the most common definition used in primality tests is for the first series 2^p-1, but the second series 2^p+1 has also been studied). The only thing I said is that Mersenne numbers (whatever their definitions) are not good enough for Knuth's fast hash, and non-primes are worse (whever they are Mersenne or not). The current implementation violates two of the Knuth's conditions, and probably as well the third by adding units *after* the multiplication and shuffling of bit positions, so this is really a (severe) bug (that publishers of Lua don't want to fix in Lua 5.4, even if it would cost absolutely nothing, can be fixed nearly instantly with no effort: ONLY 3 characters to change in one line of the C source , this is still in the timeframe for the scheduled version, there's no cost in terms of code size or speed... even if all this is proven by many wellknown publications and sources, such obstination to refuse fixing it makes no sense).