login
A258025
Numbers k such that prime(k+2) - 2*prime(k+1) + prime(k) > 0.
30
1, 3, 5, 7, 8, 10, 13, 14, 17, 20, 22, 23, 26, 28, 29, 31, 33, 35, 38, 41, 43, 45, 49, 50, 52, 57, 60, 61, 64, 65, 67, 69, 70, 71, 75, 76, 78, 79, 81, 83, 85, 86, 89, 90, 93, 95, 96, 98, 100, 104, 105, 109, 113, 116, 117, 120, 122, 123, 124, 126, 131, 134
OFFSET
1,2
LINKS
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)
A258025_list = list(islice(A258025_gen(), 20)) # Chai Wah Wu, Feb 27 2024
CROSSREFS
Partition of the positive integers: A064113, A258025, A258026;
Corresponding partition of the primes: A063535, A063535, A147812.
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.
Sequence in context: A024977 A088759 A227130 * A239419 A195439 A338446
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Jun 02 2015
STATUS
approved