{"id":117,"date":"2010-05-14T15:29:29","date_gmt":"2010-05-14T19:29:29","guid":{"rendered":"http:\/\/bitc.bme.emory.edu\/~lzhou\/blogs\/?p=117"},"modified":"2010-05-14T15:29:29","modified_gmt":"2010-05-14T19:29:29","slug":"the-rank-of-primes","status":"publish","type":"post","link":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/?p=117","title":{"rendered":"The rank of primes"},"content":{"rendered":"<p>Brillhart &#8211; Lehmer &#8211; Selfridge algorithm provides a general primality proving method as long as you can factor P+1 or P-1.  Therefore, for any prime number, when P+1 or P-1 get fully factored, the primality of any factors of P+1 or P-1 can also be proven by the same algorithm recursively.  <\/p>\n<p>For example, prime number P0=131, P0+1=132=2^2*3*11.<br \/>\nP1[1]=2 is trival prime, no recursion needed, recursion depth = 0;<br \/>\nP1[2]=3, P1[2]-1=2 is trival prime, one recursion, recursion depth = 1;<br \/>\nP1[3]=11; P1[3]+1=12=2^2*3; one more recursion from 3, recursion depth = 2;<br \/>\nSo, P=131 has total maximum recursion depth 2+1 = 3.<\/p>\n<p>We define the maximum recursion depth of the primality proving sequence using Brillhart &#8211; Lehmer &#8211; Selfridge algorithm as the rank of the prime number.<\/p>\n<p>In this way, we can easily find, that<br \/>\n2 has the rank of 0;<br \/>\n3 is the smallest prime ranked 1;<br \/>\n11 is the smallest prime ranked 2;<br \/>\n131 is the smallest prime ranked 3;<\/p>\n<p>The following Mathematica program is used to figure the rank of prime numbers until a rank 7 prime is found:<\/p>\n<p>Fr[n_]:=<br \/>\nModule[{nm, np, fm, fp, szm, szp, maxm, maxp, thism, thisp, res, jm, jp},<br \/>\nIf[n == 2, res = 0,<br \/>\nnm = n &#8211; 1; np = n + 1; fm = FactorInteger[nm]; fp = FactorInteger[np]; szm = Length[fm];<br \/>\nszp = Length[fp]; maxm = 0;<br \/>\nDo[thism = Fr[fm[[jm]][[1]]];<br \/>\nIf[maxm &lt; thism, maxm = thism], {jm, 1, szm}];<br \/>\nmaxp = 0;<br \/>\nDo[thisp = Fr[fp[[jp]][[1]]];<br \/>\nIf[maxp  maxp, res = maxp]; res++]; res];<br \/>\ni=1;While[p = Prime[i]; s = Fr[p];[p, s] &gt;&gt;&gt; &#8220;prime_rank.out&#8221;;s&lt;7,i++]<\/p>\n<p>The result:<br \/>\n1571 is the smallest prime ranked 4;<br \/>\n43717 is the smallest prime ranked 5;<br \/>\n5032843  is the smallest prime ranked 6;<br \/>\n1047774137 is the smallest prime ranked 7.<\/p>\n<p>The result:<br \/>\nAll Mersenne and Fermat primes have the rank of 1;<br \/>\nAll Woodall, Cullen, General Woodall, General Cullen, General Fermat primes&#8217; rank is one more than the rank of the highest ranked factor of k and n.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Brillhart &#8211; Lehmer &#8211; Selfridge algorithm provides a general primality proving method as long as you can factor P+1 or P-1. Therefore, for any prime number, when P+1 or P-1 get fully factored, the primality of any factors of P+1 or P-1 can also be proven by the same algorithm recursively. For example, prime number [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,6],"tags":[],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-to-entertain-myself","category-looking-for-a-megaprime","post-blog"],"_links":{"self":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=117"}],"version-history":[{"count":0,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/csic.som.emory.edu\/~lzhou\/blogs\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}