OFFSET
1,1
COMMENTS
Positions of strict descents in the sequence of differences between primes. Partial sums of A333215. - Gus Wiseman, Mar 24 2020
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
Wikipedia, Longest increasing subsequence
EXAMPLE
The prime gaps split into the following maximal weakly increasing subsequences: (1,2,2,4), (2,4), (2,4,6), (2,6), (4), (2,4,6,6), (2,6), (4), (2,6), (4,6,8), (4), (2,4), (2,4,14), ... Then a(n) is the n-th partial sum of the lengths of these subsequences. - Gus Wiseman, Mar 24 2020
MATHEMATICA
u = Table[Sign[Prime[n+2] - 2 Prime[n+1] + Prime[n]], {n, 1, 200}];
Flatten[Position[u, 0]] (* A064113 *)
Flatten[Position[u, 1]] (* A258025 *)
Flatten[Position[u, -1]] (* A258026 *)
Accumulate[Length/@Split[Differences[Array[Prime, 100]], LessEqual]]//Most (* Gus Wiseman, Mar 24 2020 *)
PROG
(Python)
from itertools import count, islice
from sympy import prime, nextprime
def A258026_gen(startvalue=1): # generator of terms >= startvalue
c = max(startvalue, 1)
p = prime(c)
q = nextprime(p)
r = nextprime(q)
for k in count(c):
if p+r<(q<<1):
yield k
p, q, r = q, r, nextprime(r)
CROSSREFS
Adjacent terms differing by 1 correspond to strong prime quartets A054804.
The version for the Kolakoski sequence is A156242.
First differences are A333215 (if the first term is 0).
The version for strict ascents is A258025.
The version for weak ascents is A333230.
The version for weak descents is A333231.
Prime gaps are A001223.
Positions of adjacent equal prime gaps are A064113.
Weakly increasing runs of compositions in standard order are A124766.
Strictly decreasing runs of compositions in standard order are A124769.
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 05 2015
STATUS
approved