mersenneforum.org Exponents of Known Mersenne Primes (Numerical Observations)
 Register FAQ Search Today's Posts Mark Forums Read

2022-10-09, 05:39   #1
Dobri

"ม้าไฟ"
May 2018

22·5·23 Posts
Exponents of Known Mersenne Primes (Numerical Observations)

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]
Attached Files
 Hamming.pdf (7.6 KB, 44 views)

 2022-10-09, 18:57 #2 Dobri   "ม้าไฟ" 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]] Attached Thumbnails
 2022-10-10, 05:36 #3 Dobri   "ม้าไฟ" 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
 2022-10-10, 08:47 #4 Dobri   "ม้าไฟ" 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]] Attached Thumbnails   Last fiddled with by Dobri on 2022-10-10 at 09:18
 2022-10-11, 05:39 #5 Dobri   "ม้าไฟ" 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.
 2022-10-11, 06:25 #6 Dobri   "ม้าไฟ" 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]] Attached Thumbnails
 2022-10-11, 08:36 #7 Dobri   "ม้าไฟ" 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]] Attached Thumbnails
 2022-10-11, 10:14 #8 Dobri   "ม้าไฟ" 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]] Attached Thumbnails
 2022-10-11, 11:08 #9 Dobri   "ม้าไฟ" 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. Attached Thumbnails
 2022-10-11, 14:28 #10 Dobri   "ม้าไฟ" 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]] Attached Thumbnails
 2022-10-11, 15:31 #11 Dobri   "ม้าไฟ" 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.

 Similar Threads Thread Thread Starter Forum Replies Last Post carpetpool Miscellaneous Math 5 2022-10-19 01:44 Dobri Dobri 3 2021-10-05 06:56 hansl Math 3 2020-09-02 10:40 ProximaCentauri Miscellaneous Math 15 2014-12-25 14:26 Lee Yiyuan Miscellaneous Math 60 2011-03-01 12:22

All times are UTC. The time now is 03:44.

Wed Feb 8 03:44:12 UTC 2023 up 174 days, 1:12, 1 user, load averages: 0.52, 0.85, 0.94