OFFSET
1,2
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
EXAMPLE
5 - 2*3 + 2 = 1, so a(1) = 5.
MATHEMATICA
u = Table[Sign[Prime[n+2] - 2 Prime[n+1] + Prime[n]], {n, 3, 200}];
Flatten[Position[u, 0]] (* A064113 *)
Flatten[Position[u, 1]] (* A258025 *)
Flatten[Position[u, -1]] (* A258026 *)
Accumulate[Length/@Split[Differences[Array[Prime, 100]], #1>=#2&]]//Most (* Gus Wiseman, Mar 25 2020 *)
Position[Partition[Prime[Range[150]], 3, 1], _?(#[[3]]-2#[[2]]+#[[1]]> 0&), 1, Heads->False]//Flatten (* Harvey P. Dale, Dec 25 2021 *)
PROG
(PARI) isok(k) = prime(k+2) - 2*prime(k+1) + prime(k) > 0; \\ Michel Marcus, Jun 03 2015
(PARI) is(n, p=prime(n))=my(q=nextprime(p+1), r=nextprime(q+1)); p + r > 2*q
v=List(); n=0; forprime(p=2, 1e4, if(is(n++, p), listput(v, n))); v \\ Charles R Greathouse IV, Jun 03 2015
(Python)
from itertools import count, islice
from sympy import prime, nextprime
def A258025_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 weak prime quartets A054819.
The version for the Kolakoski sequence is A156243.
The version for strict descents is A258026.
The version for weak ascents is A333230.
The version for weak descents is A333231.
First differences are A333212 (if the first term is 0).
Prime gaps are A001223.
Positions of adjacent equal prime gaps are A064113.
Weakly decreasing runs of compositions in standard order are A124765.
A triangle counting compositions by strict ascents is A238343.
Positions of adjacent unequal prime gaps are A333214.
Lengths of maximal anti-runs of prime gaps are A333216.
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 02 2015
STATUS
approved