OFFSET
1,2
COMMENTS
All terms of A005250 are in the sequence, but some terms of A005250 appear in this sequence more than once.
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
REFERENCES
R. K. Guy, Unsolved problems in number theory.
EXAMPLE
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.
MATHEMATICA
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}]
DeleteDuplicates[Differences[Prime[Range[10^7]]], Greater] (* Harvey P. Dale, Jan 17 2024 *)
PROG
(Python)
from sympy import nextprime; p, r = 2, 0
while r < 778:
q = nextprime(p); g = q - p
if g >= r: print(g, end = ', '); r = g
p = q # Ya-Ping Lu, Jan 23 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Farideh Firoozbakht, Aug 11 2003
EXTENSIONS
a(53)-a(63) from Donovan Johnson, Nov 24 2008
a(64)-a(76) from Charles R Greathouse IV, May 09 2011
a(77)-a(79) from Charles R Greathouse IV, May 19 2011
STATUS
approved