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.

A258026 Numbers k such that prime(k+2) - 2*prime(k+1) + prime(k) < 0.

This page as a plain text file.
%I A258026 #20 Feb 28 2024 10:21:11
%S A258026 4,6,9,11,12,16,18,19,21,24,25,27,30,32,34,37,40,42,44,47,48,51,53,56,
%T A258026 58,59,62,63,66,68,72,74,77,80,82,84,87,88,91,92,94,97,99,101,103,106,
%U A258026 108,111,112,114,115,119,121,125,127,128,130,132,133,135,137
%N A258026 Numbers k such that prime(k+2) - 2*prime(k+1) + prime(k) < 0.
%C A258026 Positions of strict descents in the sequence of differences between primes. Partial sums of A333215. - _Gus Wiseman_, Mar 24 2020
%H A258026 Clark Kimberling, <a href="/A258026/b258026.txt">Table of n, a(n) for n = 1..1000</a>
%H A258026 Wikipedia, <a href="https://en.wikipedia.org/wiki/Longest_increasing_subsequence">Longest increasing subsequence</a>
%e A258026 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
%t A258026 u = Table[Sign[Prime[n+2] - 2 Prime[n+1] + Prime[n]], {n, 1, 200}];
%t A258026 Flatten[Position[u, 0]]   (* A064113 *)
%t A258026 Flatten[Position[u, 1]]   (* A258025 *)
%t A258026 Flatten[Position[u, -1]]  (* A258026 *)
%t A258026 Accumulate[Length/@Split[Differences[Array[Prime,100]],LessEqual]]//Most (* _Gus Wiseman_, Mar 24 2020 *)
%o A258026 (Python)
%o A258026 from itertools import count, islice
%o A258026 from sympy import prime, nextprime
%o A258026 def A258026_gen(startvalue=1): # generator of terms >= startvalue
%o A258026     c = max(startvalue,1)
%o A258026     p = prime(c)
%o A258026     q = nextprime(p)
%o A258026     r = nextprime(q)
%o A258026     for k in count(c):
%o A258026         if p+r<(q<<1):
%o A258026             yield k
%o A258026         p, q, r = q, r, nextprime(r)
%o A258026 A258026_list = list(islice(A258026_gen(),20)) # _Chai Wah Wu_, Feb 27 2024
%Y A258026 Partition of the positive integers:  A064113, A258025, A258026;
%Y A258026 Corresponding partition of the primes: A063535, A063535, A147812.
%Y A258026 Adjacent terms differing by 1 correspond to strong prime quartets A054804.
%Y A258026 The version for the Kolakoski sequence is A156242.
%Y A258026 First differences are A333215 (if the first term is 0).
%Y A258026 The version for strict ascents is A258025.
%Y A258026 The version for weak ascents is A333230.
%Y A258026 The version for weak descents is A333231.
%Y A258026 Prime gaps are A001223.
%Y A258026 Positions of adjacent equal prime gaps are A064113.
%Y A258026 Weakly increasing runs of compositions in standard order are A124766.
%Y A258026 Strictly decreasing runs of compositions in standard order are A124769.
%Y A258026 Cf. A000040, A000720, A001221, A036263, A054819, A084758, A124765, A124768, A333212, A333213, A333214, A333256.
%K A258026 nonn,easy
%O A258026 1,1
%A A258026 _Clark Kimberling_, Jun 05 2015