A333254
Lengths of maximal runs in the sequence of prime gaps (A001223).
Original entry on oeis.org
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
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), ...
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).
Positions of adjacent equal prime gaps are
A064113.
Positions of adjacent unequal prime gaps are
A333214.
-
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
-
Length/@Split[Differences[Array[Prime,100]],#1==#2&]//Most
A037201
Differences between consecutive primes (A001223) but with repeats omitted.
Original entry on oeis.org
1, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 4, 6, 2, 10, 2, 4, 2, 12, 4, 2, 4, 6, 2, 10, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 8, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6, 4, 6, 8, 4
Offset: 1
This is the run-compression of
A001223 = first differences of
A000040.
The repeats were at positions
A064113 before being omitted.
Adding up runs instead of compressing them gives
A373822.
For prime-powers instead of prime numbers we have
A376308.
A003242 counts compressed compositions.
A333254 lists run-lengths of differences between consecutive primes.
A373948 encodes compression using compositions in standard order.
Cf.
A007921,
A030173,
A053289,
A106356,
A114901,
A116608,
A116861,
A124767,
A238130,
A333755,
A335406,
A373954.
-
a037201 n = a037201_list !! (n-1)
a037201_list = f a001223_list where
f (x:xs@(x':_)) | x == x' = f xs
| otherwise = x : f xs
-- Reinhard Zumkeller, Feb 27 2012
-
Flatten[Split[Differences[Prime[Range[150]]]]/.{(k_)..}:>k] (* based on a program by Harvey P. Dale, Jun 21 2012 *)
-
t=0;p=2;forprime(q=3,1e3,if(q-p!=t,print1(q-p", "));t=q-p;p=q) \\ Charles R Greathouse IV, Feb 27 2012
A376680
Run-lengths of first differences of composite numbers.
Original entry on oeis.org
2, 2, 2, 2, 2, 2, 1, 4, 2, 4, 1, 2, 2, 2, 1, 4, 1, 4, 2, 4, 1, 2, 2, 4, 1, 2, 1, 4, 1, 6, 1, 2, 2, 2, 2, 2, 1, 12, 1, 2, 1, 4, 2, 8, 2, 4, 1, 4, 1, 2, 1, 4, 1, 4, 2, 8, 2, 2, 2, 10, 1, 10, 1, 2, 2, 2, 1, 4, 2, 8, 1, 4, 1, 4, 1, 4, 2, 4, 1, 2, 2, 8, 1, 12, 1, 2
Offset: 1
The composite numbers (A002808) are:
4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, ...
with first differences (A073783):
2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, ...
with runs:
(2,2), (1,1), (2,2), (1,1), (2,2), (1,1), (2), (1,1,1,1), (2,2), (1,1,1,1), ...
with lengths (A376680):
2, 2, 2, 2, 2, 2, 1, 4, 2, 4, 1, 2, 2, 2, 1, 4, 1, 4, 2, 4, 1, 2, 2, 4, 1, 2, ...
For prime instead of composite we have
A333254, first appearances
A335406.
These are the first differences of
A376603.
A064113 lists positions of adjacent equal prime gaps.
A373825
Position of first appearance of n in the run-lengths (differing by 0) of the run-lengths (differing by 2) of the odd primes.
Original entry on oeis.org
1, 2, 13, 11, 105, 57, 33, 69, 59, 29, 227, 129, 211, 341, 75, 321, 51, 45, 407, 313, 459, 301, 767, 1829, 413, 537, 447, 1113, 1301, 1411, 1405, 2865, 1709, 1429, 3471, 709, 2543, 5231, 1923, 679, 3301, 2791, 6555, 5181, 6345, 11475, 2491, 10633
Offset: 1
The runs of odd primes differing by 2 begin:
3 5 7
11 13
17 19
23
29 31
37
41 43
47
53
59 61
67
71 73
79
with lengths:
3, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, ...
which have runs beginning:
3
2 2
1
2
1
2
1 1
2
1
2
1 1 1 1
2 2
1 1 1
with lengths:
1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 4, 2, 3, 2, 4, 3, ...
with positions of first appearances a(n).
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
-
t=Length/@Split[Length/@Split[Select[Range[3,10000], PrimeQ],#1+2==#2&]//Most]//Most;
spna[y_]:=Max@@Select[Range[Length[y]],SubsetQ[t,Range[#1]]&];
Table[Position[t,k][[1,1]],{k,spna[t]}]
A373824
Sorted positions of first appearances in the run-lengths (differing by 0) of the run-lengths (differing by 2) of the odd primes.
Original entry on oeis.org
1, 2, 11, 13, 29, 33, 45, 51, 57, 59, 69, 75, 105, 129, 211, 227, 301, 313, 321, 341, 407, 413, 447, 459, 537, 679, 709, 767, 1113, 1301, 1405, 1411, 1429, 1439, 1709, 1829, 1923, 2491, 2543, 2791, 2865, 3301, 3471, 3641, 4199, 4611, 5181, 5231, 6345, 6555
Offset: 1
The runs of odd primes differing by 2 begin:
3 5 7
11 13
17 19
23
29 31
37
41 43
47
53
59 61
67
71 73
79
with lengths:
3, 2, 2, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 2, 2, ...
which have runs beginning:
3
2 2
1
2
1
2
1 1
2
1
2
1 1 1 1
2 2
1 1 1
with lengths:
1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 4, 2, 3, 2, 4, 3,...
with sorted positions of first appearances a(n).
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
-
t=Length/@Split[Length/@Split[Select[Range[3,10000],PrimeQ],#1+2==#2&]];
Select[Range[Length[t]],FreeQ[Take[t,#-1],t[[#]]]&]
A373817
Positions of terms > 1 in the run-lengths of the first differences of the odd primes.
Original entry on oeis.org
2, 14, 34, 36, 42, 49, 66, 94, 98, 100, 107, 117, 147, 150, 169, 171, 177, 181, 199, 219, 250, 268, 315, 333, 361, 392, 398, 435, 477, 488, 520, 565, 570, 585, 592, 595, 628, 642, 660, 666, 688, 715, 744, 765, 772, 778, 829, 842, 897, 906, 931, 932, 961, 1025
Offset: 1
Primes 54 to 57 are {251, 257, 263, 269}, with differences (6,6,6). This is the 49th run, and the first of length > 2.
Positions of adjacent equal prime gaps are
A064113.
Positions of adjacent unequal prime gaps are
A333214.
A046933 counts composite numbers between primes.
A065855 counts composite numbers up to n.
A071148 gives partial sums of odd primes.
Showing 1-6 of 6 results.
Comments