cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A177854 Smallest prime of rank n.

This page as a plain text file.
%I A177854 #23 Jul 13 2025 11:07:41
%S A177854 2,3,11,131,1571,43717,5032843,1047774137,7128418089643
%N A177854 Smallest prime of rank n.
%C A177854 The Brillhart-Lehmer-Selfridge algorithm provides a general method for proving the primality of P as long as one can factor P+1 or P-1. Therefore for any prime number, when P+1 or P-1 is completely factored, the primality of any factors of P+1 or P-1 can also be proved by the same algorithm. The shortest recursive primality proving chain depth is called the rank of P (cf. A169818).
%H A177854 J. Brillhart, D. H. Lehmer and J. L. Selfridge, <a href="http://dx.doi.org/10.1090/S0025-5718-1975-0384673-1">New primality criteria and factorizations of 2^m+-1</a>, Math. Compl. 29 (1975) 620-647.
%H A177854 Wikipedia, <a href="http://en.wikipedia.org/wiki/Lucas%E2%80%93Lehmer%E2%80%93Riesel_test">Lucas-Lehmer-Riesel test</a>.
%H A177854 Lei Zhou, <a href="https://csic.som.emory.edu/~lzhou/blogs/?p=117">The rank of primes</a>.
%e A177854 The "trivial" prime 2 has rank 0. 3 = 2+1 takes one step to reduce to 2, so 3 has rank 1.
%e A177854 P=131: P+1=132=2^2*3*11. P1[1]=2 has rank 0; P1[2]=3 has rank 1; P1[3]=11: P1[3]+1=12=2^2*3; is one step from 3 and has recursion depth = 2. So P=131 has total maximum recursion depth 2+1 = 3 and therefore has rank 3.
%t A177854 (* The following program runs through all prime numbers until it finds the first rank n prime. (It took about a week for n = 7.) *) Fr[n_]:= Module[{nm, np, fm, fp, szm, szp, maxm, maxp, thism, thisp, res, jm, jp}, If[n == 2, res = 0, nm = n - 1; np = n + 1; fm = FactorInteger[nm]; fp = FactorInteger[np]; szm = Length[fm]; szp = Length[fp]; maxm = 0; Do[thism = Fr[fm[[jm]][[1]]]; If[maxm < thism, maxm = thism], {jm, 1, szm}]; maxp = 0; Do[thisp = Fr[fp[[jp]][[1]]]; If[maxp < thisp, maxp = thisp], {jp, 1, szp}]; res = Min[maxm, maxp] + 1 ]; res]; target=0; Do[p = Prime[i]; s = Fr[p]; If[s == target, Print[p]; target++], {i, Infinity}]
%o A177854 (PARI) rank(p)=if(p<8, return(p>2)); vecmin(apply(k->vecmax(apply(rank, factor(k)[,1])), [p-1,p+1]))+1
%o A177854 print1(2); r=0;forprime(p=3,, t=rank(p); if(t>r, r=t; print1(", "p))) \\ _Charles R Greathouse IV_, Oct 03 2016
%Y A177854 These are the primes where records occur in A169818.
%Y A177854 Cf. A005113, A056637. - _Robert G. Wilson v_, May 28 2010
%K A177854 hard,nonn,more,nice
%O A177854 0,1
%A A177854 _Lei Zhou_, May 14 2010
%E A177854 Partially edited by _N. J. A. Sloane_, May 15 2010, May 28 2010
%E A177854 Definition corrected by _Robert Gerbicz_, May 28 2010
%E A177854 a(8) from _Florian Baur_, Sep 05 2024