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!)
A085237 Nondecreasing gaps between primes. 5

%I #35 Feb 15 2024 06:18:19

%S 1,2,2,4,4,4,6,6,6,6,6,6,6,8,14,14,14,18,20,22,34,34,36,36,36,44,52,

%T 52,72,86,86,96,112,114,118,132,132,148,154,154,154,180,210,220,222,

%U 234,248,250,250,282,288,292,320,336,336,354,382,384,394,456,464,468,474,486,490,500,514,516,532,534,540,582,588,602,652,674,716,766,778

%N Nondecreasing gaps between primes.

%C All terms of A005250 are in the sequence, but some terms of A005250 appear in this sequence more than once.

%C a(n) is the gap between the n-th and (n+1)-th sublists of prime numbers defined in A348178. - _Ya-Ping Lu_, Oct 19 2021

%D R. K. Guy, Unsolved problems in number theory.

%e a(21) = a(22) = 34 because prime(218) - prime(217) = prime(1060) - prime(1059) = 34 and prime(n+1) - prime(n) is less than 34, for n < 1059 and n not equal to 217.

%t f[n_] := Prime[n+1]-Prime[n]; v={}; Do[ If[f[n]>=If[n==1, 1, v[[ -1]]], v1=n; v=Append[v, f[v1]]; Print[v]], {n, 105000000}]

%t DeleteDuplicates[Differences[Prime[Range[10^7]]],Greater] (* _Harvey P. Dale_, Jan 17 2024 *)

%o (Python)

%o from sympy import nextprime; p, r = 2, 0

%o while r < 778:

%o q = nextprime(p); g = q - p

%o if g >= r: print(g, end = ', '); r = g

%o p = q # _Ya-Ping Lu_, Jan 23 2024

%Y Cf. A005250, A005669, A053686, A002386, A348178.

%K nonn

%O 1,2

%A _Farideh Firoozbakht_, Aug 11 2003

%E a(53)-a(63) from _Donovan Johnson_, Nov 24 2008

%E a(64)-a(76) from _Charles R Greathouse IV_, May 09 2011

%E a(77)-a(79) from _Charles R Greathouse IV_, May 19 2011

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 April 19 18:05 EDT 2024. Contains 371798 sequences. (Running on oeis4.)