cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A333254 Lengths of maximal runs in the sequence of prime gaps (A001223).

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