%I #14 Jan 06 2021 19:19:24
%S 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,
%T 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,
%U 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
%N Lengths of maximal runs in the sequence of prime gaps (A001223).
%C Prime gaps are differences between adjacent prime numbers.
%C Also lengths of maximal arithmetic progressions of consecutive primes.
%H Robert Israel, <a href="/A333254/b333254.txt">Table of n, a(n) for n = 1..10000</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Arithmetic_progression">Arithmetic progression</a>
%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Longest_increasing_subsequence">Longest increasing subsequence</a>
%F Partial sums are A333214.
%e 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), ...
%p p:= 3: t:= 1: R:= NULL: s:= 1: count:= 0:
%p for i from 2 while count < 100 do
%p q:= nextprime(p);
%p g:= q-p; p:= q;
%p if g = t then s:= s+1
%p else count:= count+1; R:= R, s; t:= g; s:= 1;
%p fi
%p od:
%p R; # _Robert Israel_, Jan 06 2021
%t Length/@Split[Differences[Array[Prime,100]],#1==#2&]//Most
%Y The version for A000002 is A000002. Similarly for A001462.
%Y The unequal version is A333216.
%Y The weakly decreasing version is A333212.
%Y The weakly increasing version is A333215.
%Y The strictly decreasing version is A333252.
%Y The strictly increasing version is A333253.
%Y Positions of first appearances are A335406.
%Y The first term of the first length-n arithmetic progression of consecutive primes is A006560(n), with index A089180(n).
%Y Prime gaps are A001223.
%Y Positions of adjacent equal prime gaps are A064113.
%Y Positions of adjacent unequal prime gaps are A333214.
%Y Cf. A000040, A031217, A054800, A059044, A084758, A090832, A124767, A238279, A295235.
%K nonn
%O 1,2
%A _Gus Wiseman_, Mar 20 2020
|