The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A063095 Record prime gap among first n+1 primes. 5

%I #12 Sep 11 2019 16:37:12

%S 1,2,2,4,4,4,4,4,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,8,8,8,8,8,8,14,14,14,

%T 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,

%U 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14

%N Record prime gap among first n+1 primes.

%D D. S. Mitrinovic et al., Handbook of Number Theory, Kluwer, 1996, Section VII.22, p. 249. (See G(x), which is an analog of pi(x).)

%H Chai Wah Wu, <a href="/A063095/b063095.txt">Table of n, a(n) for n = 1..10000</a>

%e A value of d in this sequence persists until a larger value arises. Note that values like 10, 12, 16 are never maximal. Distinct, increasing prime gaps are given in A005250.

%t Table[Max[Table[Prime[w+1]-Prime[w], {w, 1, j}]], {j, 1, 500}] a(n)= Max{p[j+1]-p[j]; j=1, ..n}

%o (Python)

%o from sympy import nextprime

%o def A063095(n):

%o c, p = 0, 2

%o for i in range(n):

%o q = nextprime(p)

%o c, p = max(c,q-p), q

%o return c # _Chai Wah Wu_, Sep 11 2019

%Y Cf. A005250, A001223, A063096.

%K nonn

%O 1,2

%A _Labos Elemer_, Aug 07 2001

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 6 16:50 EDT 2024. Contains 373133 sequences. (Running on oeis4.)