A333254 Lengths of maximal runs in the sequence of prime gaps (A001223).
1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1
Keywords
Examples
The prime gaps split into the following runs: (1), (2,2), (4), (2), (4), (2), (4), (6), (2), (6), (4), (2), (4), (6,6), (2), (6), (4), ...
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
- Wikipedia, Arithmetic progression
- Wikipedia, Longest increasing subsequence
Crossrefs
The unequal version is A333216.
The weakly decreasing version is A333212.
The weakly increasing version is A333215.
The strictly decreasing version is A333252.
The strictly increasing version is A333253.
Positions of first appearances are A335406.
The first term of the first length-n arithmetic progression of consecutive primes is A006560(n), with index A089180(n).
Prime gaps are A001223.
Positions of adjacent equal prime gaps are A064113.
Positions of adjacent unequal prime gaps are A333214.
Programs
-
Maple
p:= 3: t:= 1: R:= NULL: s:= 1: count:= 0: for i from 2 while count < 100 do q:= nextprime(p); g:= q-p; p:= q; if g = t then s:= s+1 else count:= count+1; R:= R, s; t:= g; s:= 1; fi od: R; # Robert Israel, Jan 06 2021
-
Mathematica
Length/@Split[Differences[Array[Prime,100]],#1==#2&]//Most
Formula
Partial sums are A333214.
Comments