A241540 Indices of primes p in A182514, i.e., a(n) = primepi(p) = A000720(A182514(n)).
1, 2, 4, 30, 217, 49749629143526
Offset: 1
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.
s = {2}; gm = 1; Do[p = Prime[n]; g = Prime[n + 1] - p; If[g > gm, Print[p]; AppendTo[s, p]; gm = g], {n, 2, 1000000}]; s (* Jean-François Alcover, Mar 31 2011 *) Module[{nn=10^7,pr,df},pr=Prime[Range[nn]];df=Differences[pr];DeleteDuplicates[ Thread[ {Most[ pr],df}],GreaterEqual[#1[[2]],#2[[2]]]&]][[All,1]] (* The program generates the first 26 terms of the sequence. *) (* Harvey P. Dale, Sep 24 2022 *)
a(n)=local(p,g);if(n<2,2*(n>0),p=a(n-1);g=nextprime(p+1)-p;while(p=nextprime(p+1),if(nextprime(p+1)-p>g,break));p) /* Michael Somos, Feb 07 2004 */
p=q=2;g=0;until( g<(q=nextprime(1+p=q))-p && print1(q-g=q-p,","),) \\ M. F. Hasler, Dec 13 2007
from sympy import nextprime; p, r = 2, 0 while p < 2*10**8: q = nextprime(p); g = q - p if g >= r: print(p, end = ', '); r = g p = q # Ya-Ping Lu, Jan 23 2024
f[n_] := Prime[n+1]-Prime[n]; v1={}; v2={}; Do[If[f[n]>=If[n==1, 1, Last[v2]], v=n; v1=Append[v1, n]; v2=Append[v2, f[v]]; Print[v1]], {n, 105000000}]
a(20) = 127 since for all primes less than the 31st prime, 127, p_k^(32/31) - p_k are less than 20. a(100) = 38113, a(200) = 2400407, a(300) = 57189007, a(400) = 828882731, a(500) = 8748565643, a(1000) = 91215796479037, a(1064) = 246842748060263, limit of Mathematica by direct computation, i.e., the first Mathematica line.
f[n_] := Block[{p = 2, k = 1}, While[n > p^(1 + 1/k) - p, p = NextPrime@ p; k++]; p]; Array[f, 60] (* or quicker *) (* or quicker *) p = 2; i = 1; lst = {}; Do[ While[ p^(1 + 1/i) < n + p, p = NextPrime@ p; i++]; AppendTo[lst, p]; Print[{n, p}], {n, 100}]; lst
a(n) = {i = 0; forprime(p=2,, i++; if (p^(1+1/i) - p > n, return (p)););} \\ Michel Marcus, Oct 04 2015
prime(1)=2; a(1)=1 because k=1 is the largest k for which 3 < 2^(1+1/k). prime(2)=3; a(2)=2 because k=2 is the largest k for which 5 < 3^(1+1/k). prime(10)=29; a(10)=50 because k=50 is the largest k for which 31 < 29^(1+1/k).
[Floor(Log(NthPrime(n))/(Log(NthPrime(n+1))-Log(NthPrime(n)))): n in [1..60]]; // Vincenzo Librandi, Oct 08 2015
Table[Floor[Log@ Prime@ n /(Log@ Prime[n + 1] - Log@ Prime@ n)], {n, 58}] (* Michael De Vlieger, Oct 08 2015 *)
a(n) = floor(log(prime(n))/(log(prime(n+1)) - log(prime(n)))) \\ Michel Marcus, Oct 10 2015
Comments