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.

A258025 Numbers k such that prime(k+2) - 2*prime(k+1) + prime(k) > 0.

This page as a plain text file.
%I A258025 #23 Feb 27 2024 11:36:10
%S A258025 1,3,5,7,8,10,13,14,17,20,22,23,26,28,29,31,33,35,38,41,43,45,49,50,
%T A258025 52,57,60,61,64,65,67,69,70,71,75,76,78,79,81,83,85,86,89,90,93,95,96,
%U A258025 98,100,104,105,109,113,116,117,120,122,123,124,126,131,134
%N A258025 Numbers k such that prime(k+2) - 2*prime(k+1) + prime(k) > 0.
%H A258025 Clark Kimberling, <a href="/A258025/b258025.txt">Table of n, a(n) for n = 1..1000</a>
%e A258025 5 - 2*3 + 2 = 1, so a(1) = 5.
%t A258025 u = Table[Sign[Prime[n+2] - 2 Prime[n+1] + Prime[n]], {n, 3, 200}];
%t A258025 Flatten[Position[u, 0]]   (* A064113 *)
%t A258025 Flatten[Position[u, 1]]   (* A258025 *)
%t A258025 Flatten[Position[u, -1]]  (* A258026 *)
%t A258025 Accumulate[Length/@Split[Differences[Array[Prime,100]],#1>=#2&]]//Most (* _Gus Wiseman_, Mar 25 2020 *)
%t A258025 Position[Partition[Prime[Range[150]],3,1],_?(#[[3]]-2#[[2]]+#[[1]]> 0&),1,Heads->False]//Flatten (* _Harvey P. Dale_, Dec 25 2021 *)
%o A258025 (PARI) isok(k) = prime(k+2) - 2*prime(k+1) + prime(k) > 0; \\ _Michel Marcus_, Jun 03 2015
%o A258025 (PARI) is(n,p=prime(n))=my(q=nextprime(p+1),r=nextprime(q+1)); p + r > 2*q
%o A258025 v=List(); n=0; forprime(p=2,1e4, if(is(n++,p), listput(v,n))); v \\ _Charles R Greathouse IV_, Jun 03 2015
%o A258025 (Python)
%o A258025 from itertools import count, islice
%o A258025 from sympy import prime, nextprime
%o A258025 def A258025_gen(startvalue=1): # generator of terms >= startvalue
%o A258025     c = max(startvalue,1)
%o A258025     p = prime(c)
%o A258025     q = nextprime(p)
%o A258025     r = nextprime(q)
%o A258025     for k in count(c):
%o A258025         if p+r>(q<<1):
%o A258025             yield k
%o A258025         p, q, r = q, r, nextprime(r)
%o A258025 A258025_list = list(islice(A258025_gen(),20)) # _Chai Wah Wu_, Feb 27 2024
%Y A258025 Partition of the positive integers:  A064113, A258025, A258026;
%Y A258025 Corresponding partition of the primes: A063535, A063535, A147812.
%Y A258025 Adjacent terms differing by 1 correspond to weak prime quartets A054819.
%Y A258025 The version for the Kolakoski sequence is A156243.
%Y A258025 The version for strict descents is A258026.
%Y A258025 The version for weak ascents is A333230.
%Y A258025 The version for weak descents is A333231.
%Y A258025 First differences are A333212 (if the first term is 0).
%Y A258025 Prime gaps are A001223.
%Y A258025 Positions of adjacent equal prime gaps are A064113.
%Y A258025 Weakly decreasing runs of compositions in standard order are A124765.
%Y A258025 A triangle counting compositions by strict ascents is A238343.
%Y A258025 Positions of adjacent unequal prime gaps are A333214.
%Y A258025 Lengths of maximal anti-runs of prime gaps are A333216.
%Y A258025 Cf. A000040, A036263, A084758, A114994, A124760, A124761, A124766, A333215.
%K A258025 nonn,easy
%O A258025 1,2
%A A258025 _Clark Kimberling_, Jun 02 2015