![]() |
![]() |
#1 |
"ม้าไฟ"
May 2018
22·5·23 Posts |
![]()
The first post of this thread shows the Hamming distances between the consecutive exponents of known Mersenne primes:
{1,2,1,2,3,1,2,2,3,3,2,6,4,4,5,4,5,5,6,8,4,5,7,5,7,11,11,10,11,10,8,9,9,9,8,11,12,11,11,12,13,11,13,17,11,13,11,14,12,13}. Below is the Wolfram code used to plot a linear fit for said Hamming distances in the attached PDF file. Code:
MpData = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933}; nMp = Length[MpData]; hda = ConstantArray[0, nMp - 1];base = 2; intlen = 27; ic = 1; While[ic < nMp, ic++; hda[[ic - 1]] = HammingDistance[IntegerDigits[MpData[[ic - 1]], base, intlen], IntegerDigits[MpData[[ic]], base, intlen]];]; Print[hda]; hdafit = LinearModelFit[hda, x, x]; Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True] |
![]() |
![]() |
![]() |
#2 |
"ม้าไฟ"
May 2018
7148 Posts |
![]()
After dividing the Hamming distance by the average number of bits of the pairs of consecutive exponents, the linear fit gives a nearly horizontal line as shown in the attached image.
Code:
ClearAll; MpData = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933}; nMp = Length[MpData]; hda = ConstantArray[1, nMp - 1]; base = 2; intlen = 27; ic = 1; While[ic < nMp, ic++; hda[[ic - 1]] = HammingDistance[IntegerDigits[MpData[[ic - 1]], base, intlen], IntegerDigits[MpData[[ic]], base, intlen]]/((Length[IntegerDigits[MpData[[ic - 1]], base]] + Length[IntegerDigits[MpData[[ic]], base]])/2);]; hdafit = LinearModelFit[hda, x, x]; Export["Hamming.jpg", Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True]] |
![]() |
![]() |
![]() |
#3 |
"ม้าไฟ"
May 2018
7148 Posts |
![]()
Let's put the meaning of the graph in post #2 at https://www.mersenneforum.org/showpo...10&postcount=2 into words:
The current estimate of the average base-2 Hamming distance per bit (HAMD/bit) between consecutive exponents of Mersenne primes is bounded in the interval (0.45, 0.5) with a tendency toward 0.5. Last fiddled with by Dobri on 2022-10-10 at 05:38 |
![]() |
![]() |
![]() |
#4 |
"ม้าไฟ"
May 2018
22·5·23 Posts |
![]()
In the attached image, a base-2 HAMD/bit graph for all consecutive primes ≤ 1000003 is shown for a partial comparison with the graph in the previous post #2 at https://mersenneforum.org/showpost.p...10&postcount=2.
The average base-2 HAMD/bit value for all consecutive primes is less than 0.2 and has a downward tendency with the increase of the number of primes included in the computation. Code:
SetDirectory[NotebookDirectory[]]; fname = NotebookDirectory[] <> "HammingPerBitAllPrimes.jpg"; pmax = 1000003; np = PrimePi[pmax]; hda = ConstantArray[0, np-1]; base = 2; intlen = Length[IntegerDigits[pmax, base]]; p1 = 1; p2 = 2; ic = 0; While[p2 < pmax, p1 = p2; p2 = NextPrime[p2]; ic++; hda[[ic]] = HammingDistance[IntegerDigits[p1, base, intlen], IntegerDigits[p2, base, intlen]]/((Length[IntegerDigits[p1, base]] + Length[IntegerDigits[p2, base]])/2);]; hdafit = LinearModelFit[hda, x, x]; Show[BarChart[hda], Plot[hdafit[x], {x, 1, np}], Frame -> True] Export[fname, Show[BarChart[hda], Plot[hdafit[x], {x, 1, np}], Frame -> True]] Last fiddled with by Dobri on 2022-10-10 at 09:18 |
![]() |
![]() |
![]() |
#5 |
"ม้าไฟ"
May 2018
22×5×23 Posts |
![]()
The dimensionless HAMD/bit term is also called normalized Hamming distance (NHD) which in general describes to what extent two strings are dissimilar.
The tendency for the exponents of Mersenne primes is NHD → 0.5 which corresponds to maximum entropy. |
![]() |
![]() |
![]() |
#6 |
"ม้าไฟ"
May 2018
1110011002 Posts |
![]()
Obviously, the tendency NHD → 0.5 becomes even more prominent when dividing by the bit length of the larger exponent of a pair of two consecutive exponents (zero padding applies without saying to the smaller exponent in this post and the previous posts) as shown in the attached image.
Code:
SetDirectory[NotebookDirectory[]]; fname = NotebookDirectory[] <> "NHD.jpg"; MpData = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933}; nMp = Length[MpData]; hda = ConstantArray[1, nMp - 1]; base = 2; intlen = 27; ic = 1; While[ic < nMp, ic++; hda[[ic - 1]] = HammingDistance[IntegerDigits[MpData[[ic - 1]], base, intlen], IntegerDigits[MpData[[ic]], base, intlen]]/Length[IntegerDigits[MpData[[ic]], base]];]; hdafit = LinearModelFit[hda, x, x]; Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True] Export[fname, Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True]] |
![]() |
![]() |
![]() |
#7 |
"ม้าไฟ"
May 2018
22×5×23 Posts |
![]()
The attached image shows the normalized Levenshtein distance (NLD) (it is obtained as "the minimum number of single-character edits (insertions, deletions or substitutions) required to change one word into the other", see https://en.wikipedia.org/wiki/Levenshtein_distance) between the consecutive exponents of known Mersenne primes.
Code:
SetDirectory[NotebookDirectory[]]; fname = NotebookDirectory[] <> "NLD.jpg"; MpData = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933}; nMp = Length[MpData]; hda = ConstantArray[0, nMp - 1]; base = 2; intlen = Length[IntegerDigits[MpData[[nMp]], base]]; ic = 1; While[ic < nMp, ic++; hda[[ic - 1]] = EditDistance[IntegerDigits[MpData[[ic - 1]], base, intlen], IntegerDigits[MpData[[ic]], base, intlen]]/Length[IntegerDigits[MpData[[ic]], base]];]; hdafit = LinearModelFit[hda, x, x]; Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True] Export[fname, Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True]] |
![]() |
![]() |
![]() |
#8 |
"ม้าไฟ"
May 2018
7148 Posts |
![]()
The attached image shows the lengths (non-normalized) of the longest common contiguous subsequences (LCS) between the consecutive exponents of known Mersenne primes.
Code:
SetDirectory[NotebookDirectory[]]; fname = NotebookDirectory[] <> "LCS.jpg"; MpData = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933}; nMp = Length[MpData]; hda = ConstantArray[0, nMp - 1]; base = 2; ic = 1; While[ic < nMp, ic++; intlen1 = Length[IntegerDigits[MpData[[ic - 1]], base]]; intlen2 = Length[IntegerDigits[MpData[[ic]], base]]; hda[[ic - 1]] = Length[LongestCommonSubsequence[IntegerDigits[MpData[[ic - 1]], base, intlen1], IntegerDigits[MpData[[ic]], base, intlen2]]];]; hdafit = LinearModelFit[hda, x, x]; Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True] Export[fname, Show[BarChart[hda], Plot[hdafit[x], {x, 1, nMp}], Frame -> True]] |
![]() |
![]() |
![]() |
#9 |
"ม้าไฟ"
May 2018
22·5·23 Posts |
![]()
The attached 2 images show the base-2 Smith-Waterman similarity (SWS.jpg, see https://en.wikipedia.org/wiki/Smith%...rman_algorithm, Wolfram function SmithWatermanSimilarity) and the base-2 Needleman-Wunsch similarity (NWS.jpg, see https://en.wikipedia.org/wiki/Needleman%E2%80%93Wunsch_algorithm, Wolfram function NeedlemanWunschSimilarity) between the consecutive exponents of known Mersenne primes.
|
![]() |
![]() |
![]() |
#10 |
"ม้าไฟ"
May 2018
22·5·23 Posts |
![]()
The attached 3D image shows the lengths (non-normalized) of the longest common contiguous subsequences (LCS) between all pairs (i, j), i < j, for i, j = 1, 2,..., 51, of the exponents of known Mersenne primes.
Code:
SetDirectory[NotebookDirectory[]]; fname = NotebookDirectory[] <> "CLS3D.jpg"; MpData = {2, 3, 5, 7, 13, 17, 19, 31, 61, 89, 107, 127, 521, 607, 1279, 2203, 2281, 3217, 4253, 4423, 9689, 9941, 11213, 19937, 21701, 23209, 44497, 86243, 110503, 132049, 216091, 756839, 859433, 1257787, 1398269, 2976221, 3021377, 6972593, 13466917, 20996011, 24036583, 25964951, 30402457, 32582657, 37156667, 42643801, 43112609, 57885161, 74207281, 77232917, 82589933}; nMp = Length[MpData]; hda = ConstantArray[0, {nMp, nMp}]; base = 2; ic = 0; While[ic < nMp, ic++; jc = 0; While[jc < nMp, jc++; If[ic < jc, intlen1 = Length[IntegerDigits[MpData[[ic]], base]]; intlen2 = Length[IntegerDigits[MpData[[jc]], base]]; hda[[ic, jc]] = Length[LongestCommonSubsequence[IntegerDigits[MpData[[ic]], base, intlen1], IntegerDigits[MpData[[jc]], base, intlen2]]]; ];];]; Show[ListPlot3D[hda, InterpolationOrder -> 0, Filling -> Bottom], Frame -> True] Export[fname, Show[ListPlot3D[hda, InterpolationOrder -> 0, Filling -> Bottom], Frame -> True]] |
![]() |
![]() |
![]() |
#11 |
"ม้าไฟ"
May 2018
1110011002 Posts |
![]()
Here is an example of a 15-bit largest common subsequence:
Mersenne exponent #29 = 110503 = 110101111101001112, and Mersenne exponent #39 = 13466917 = 1100110101111101001001012. |
![]() |
![]() |
![]() |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mersenne prime exponents that are also Sophie Germain primes | carpetpool | Miscellaneous Math | 5 | 2022-10-19 01:44 |
Additive Properties of the Exponents of Known Mersenne Primes | Dobri | Dobri | 3 | 2021-10-05 06:56 |
Observations of Wieferich primes and Wieferich-1 friendly club | hansl | Math | 3 | 2020-09-02 10:40 |
Sophie-Germain primes as Mersenne exponents | ProximaCentauri | Miscellaneous Math | 15 | 2014-12-25 14:26 |
Assorted formulas for exponents of Mersenne primes | Lee Yiyuan | Miscellaneous Math | 60 | 2011-03-01 12:22 |