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.

Showing 1-10 of 12 results. Next

A333254 Lengths of maximal runs in the sequence of prime gaps (A001223).

Original entry on oeis.org

1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
Offset: 1

Views

Author

Gus Wiseman, Mar 20 2020

Keywords

Comments

Prime gaps are differences between adjacent prime numbers.
Also lengths of maximal arithmetic progressions of consecutive primes.

Examples

			The prime gaps split into the following runs: (1), (2,2), (4), (2), (4), (2), (4), (6), (2), (6), (4), (2), (4), (6,6), (2), (6), (4), ...
		

Crossrefs

The version for A000002 is A000002. Similarly for A001462.
The unequal version is A333216.
The weakly decreasing version is A333212.
The weakly increasing version is A333215.
The strictly decreasing version is A333252.
The strictly increasing version is A333253.
Positions of first appearances are A335406.
The first term of the first length-n arithmetic progression of consecutive primes is A006560(n), with index A089180(n).
Prime gaps are A001223.
Positions of adjacent equal prime gaps are A064113.
Positions of adjacent unequal prime gaps are A333214.

Programs

  • Maple
    p:= 3: t:= 1: R:= NULL: s:= 1: count:= 0:
    for i from 2 while count < 100 do
      q:= nextprime(p);
      g:= q-p; p:= q;
      if g = t then s:= s+1
      else count:= count+1; R:= R, s; t:= g; s:= 1;
      fi
    od:
    R; # Robert Israel, Jan 06 2021
  • Mathematica
    Length/@Split[Differences[Array[Prime,100]],#1==#2&]//Most

Formula

Partial sums are A333214.

A054819 First term of weak prime quartet: p(m+1)-p(m) < p(m+2)-p(m+1) < p(m+3)-p(m+2).

Original entry on oeis.org

17, 41, 79, 107, 227, 281, 311, 347, 349, 379, 397, 439, 461, 499, 569, 641, 673, 677, 827, 857, 881, 907, 1031, 1061, 1091, 1187, 1229, 1277, 1301, 1319, 1367, 1427, 1429, 1451, 1487, 1489, 1549, 1607, 1619, 1621, 1697, 1877, 1997, 2027, 2087, 2153
Offset: 1

Views

Author

Henry Bottomley, Apr 10 2000

Keywords

Examples

			From _Gus Wiseman_, May 31 2020: (Start)
The first 10 strictly increasing prime gap quartets:
   17   19   23   29
   41   43   47   53
   79   83   89   97
  107  109  113  127
  227  229  233  239
  281  283  293  307
  311  313  317  331
  347  349  353  359
  349  353  359  367
  379  383  389  397
(End)
		

Crossrefs

Prime gaps are A001223.
Second prime gaps are A036263.
Strictly decreasing prime gap quartets are A335278.
Strictly increasing prime gap quartets are A335277.
Equal prime gap quartets are A090832.
Weakly increasing prime gap quartets are A333383.
Weakly decreasing prime gap quartets are A333488.
Unequal prime gap quartets are A333490.
Partially unequal prime gap quartets are A333491.
Positions of adjacent equal prime gaps are A064113.
Positions of strict ascents in prime gaps are A258025.
Positions of strict descents in prime gaps are A258026.
Positions of adjacent unequal prime gaps are A333214.
Positions of weak ascents in prime gaps are A333230.
Positions of weak descents in prime gaps are A333231.
Lengths of maximal weakly decreasing sequences of prime gaps are A333212.
Lengths of maximal strictly increasing sequences of prime gaps are A333253.

Programs

  • Mathematica
    wpqQ[lst_]:=Module[{diffs=Differences[lst]},diffs[[1]]Harvey P. Dale, Jun 12 2012 *)
    ReplaceList[Array[Prime,100],{_,x_,y_,z_,t_,_}/;y-xx] (* Gus Wiseman, May 31 2020 *)

Formula

a(n) = prime(A335277(n)). - Gus Wiseman, May 31 2020

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

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Jun 02 2015

Keywords

Examples

			5 - 2*3 + 2 = 1, so a(1) = 5.
		

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.

Programs

  • 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 *)
  • 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

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

Original entry on oeis.org

4, 6, 9, 11, 12, 16, 18, 19, 21, 24, 25, 27, 30, 32, 34, 37, 40, 42, 44, 47, 48, 51, 53, 56, 58, 59, 62, 63, 66, 68, 72, 74, 77, 80, 82, 84, 87, 88, 91, 92, 94, 97, 99, 101, 103, 106, 108, 111, 112, 114, 115, 119, 121, 125, 127, 128, 130, 132, 133, 135, 137
Offset: 1

Views

Author

Clark Kimberling, Jun 05 2015

Keywords

Comments

Positions of strict descents in the sequence of differences between primes. Partial sums of A333215. - Gus Wiseman, Mar 24 2020

Examples

			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
		

Crossrefs

Partition of the positive integers: A064113, A258025, A258026;
Corresponding partition of the primes: A063535, A063535, A147812.
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.

Programs

  • 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 *)
  • 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)
    A258026_list = list(islice(A258026_gen(),20)) # Chai Wah Wu, Feb 27 2024

A333230 Positions of weak ascents in the sequence of differences between primes.

Original entry on oeis.org

1, 2, 3, 5, 7, 8, 10, 13, 14, 15, 17, 20, 22, 23, 26, 28, 29, 31, 33, 35, 36, 38, 39, 41, 43, 45, 46, 49, 50, 52, 54, 55, 57, 60, 61, 64, 65, 67, 69, 70, 71, 73, 75, 76, 78, 79, 81, 83, 85, 86, 89, 90, 93, 95, 96, 98, 100, 102, 104, 105, 107, 109, 110, 113
Offset: 1

Views

Author

Gus Wiseman, Mar 18 2020

Keywords

Comments

Partial sums of A333252.

Examples

			The prime gaps split into the following strictly decreasing 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), ...
		

Crossrefs

The version for the Kolakoski sequence is A022297.
The version for equal differences is A064113.
The version for strict ascents is A258025.
The version for strict descents is A258026.
The version for distinct differences is A333214.
The version for weak descents is A333231.
First differences are A333252 (if the first term is 0).
Prime gaps are A001223.
Weakly decreasing runs of standard compositions are counted by A124765.
Weakly increasing runs of standard compositions are counted by A124766.
Strictly increasing runs of standard compositions are counted by A124768.
Strictly decreasing runs of standard compositions are counted by A124769.
Runs of prime gaps with nonzero differences are A333216.

Programs

  • Mathematica
    Accumulate[Length/@Split[Differences[Array[Prime,100]],#1>#2&]]//Most
    - or -
    Select[Range[100],Prime[#+1]-Prime[#]<=Prime[#+2]-Prime[#+1]&]

Formula

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

A333216 Lengths of maximal subsequences without adjacent equal terms in the sequence of prime gaps.

Original entry on oeis.org

2, 13, 21, 3, 7, 8, 1, 18, 29, 5, 3, 8, 11, 31, 4, 20, 3, 7, 5, 19, 21, 32, 1, 19, 48, 19, 29, 32, 7, 38, 1, 43, 12, 33, 46, 6, 16, 8, 4, 34, 15, 1, 19, 7, 1, 23, 28, 30, 22, 8, 1, 7, 1, 52, 14, 56, 10, 26, 2, 30, 65, 5, 71, 12, 44, 39, 37, 6, 19, 47, 11, 10
Offset: 1

Views

Author

Gus Wiseman, Mar 15 2020

Keywords

Comments

Prime gaps are differences between adjacent prime numbers.
Essentially the same as A145024. - R. J. Mathar, Mar 16 2020

Examples

			The prime gaps split into the following subsequences without adjacent equal terms: (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,4,6,2,10,2,6), (6,4,6), (6,2,10,2,4,2,12), (12,4,2,4,6,2,10,6), ...
		

Crossrefs

First differences of A064113.
The version for the Kolakoski sequence is A306323.
The weakly decreasing version is A333212.
The weakly increasing version is A333215.
The strictly decreasing version is A333252.
The strictly increasing version is A333253.
The equal version is A333254.

Programs

  • Mathematica
    Length/@Split[Differences[Array[Prime,100]],UnsameQ]//Most

Formula

Ones correspond to balanced prime quartets (A054800), so the sum of terms up to but not including the n-th one is A000720(A054800(n - 1)) = A090832(n).

A333215 Lengths of maximal weakly increasing subsequences in the sequence of prime gaps (A001223).

Original entry on oeis.org

4, 2, 3, 2, 1, 4, 2, 1, 2, 3, 1, 2, 3, 2, 2, 3, 3, 2, 2, 3, 1, 3, 2, 3, 2, 1, 3, 1, 3, 2, 4, 2, 3, 3, 2, 2, 3, 1, 3, 1, 2, 3, 2, 2, 2, 3, 2, 3, 1, 2, 1, 4, 2, 4, 2, 1, 2, 2, 1, 2, 2, 2, 2, 2, 3, 1, 3, 1, 3, 3, 1, 4, 4, 2, 2, 2, 3, 2, 3, 1, 5, 3, 2, 2, 4, 3, 3
Offset: 1

Views

Author

Gus Wiseman, Mar 14 2020

Keywords

Comments

Prime gaps are differences between adjacent prime numbers.

Examples

			The prime gaps split into the following 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), ...
		

Crossrefs

Prime gaps are A001223.
Ones correspond to strong prime quartets A054804.
Weakly increasing runs of compositions in standard order are A124766.
First differences of A258026 (with zero prepended).
The version for the Kolakoski sequence is A332875.
The weakly decreasing version is A333212.
The unequal version is A333216.
Positions of weak ascents in prime gaps are A333230.
The strictly decreasing version is A333252.
The strictly increasing version is A333253.
The equal version is A333254.

Programs

  • Mathematica
    Length/@Split[Differences[Array[Prime,100]],#1<=#2&]//Most

Formula

Ones correspond to strong prime quartets (A054804), so the sum of terms up to but not including the n-th one is A000720(A054804(n - 1)).

A333231 Positions of weak descents in the sequence of differences between primes.

Original entry on oeis.org

2, 4, 6, 9, 11, 12, 15, 16, 18, 19, 21, 24, 25, 27, 30, 32, 34, 36, 37, 39, 40, 42, 44, 46, 47, 48, 51, 53, 54, 55, 56, 58, 59, 62, 63, 66, 68, 72, 73, 74, 77, 80, 82, 84, 87, 88, 91, 92, 94, 97, 99, 101, 102, 103, 106, 107, 108, 110, 111, 112, 114, 115, 118
Offset: 1

Views

Author

Gus Wiseman, Mar 18 2020

Keywords

Comments

Partial sums of A333253.

Examples

			The prime gaps split into the following strictly 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), ...
		

Crossrefs

The version for the Kolakoski sequence is A025505.
The version for equal differences is A064113.
The version for strict ascents is A258025.
The version for strict descents is A258026.
The version for distinct differences is A333214.
The version for weak ascents is A333230.
First differences are A333253 (if the first term is 0).
Prime gaps are A001223.
Weakly decreasing runs of compositions in standard order are A124765.
Strictly increasing runs of compositions in standard order are A124768.
Runs of prime gaps with nonzero differences are A333216.

Programs

  • Mathematica
    Accumulate[Length/@Split[Differences[Array[Prime,100]],#1<#2&]]//Most
    - or -
    Select[Range[100],Prime[#+1]-Prime[#]>=Prime[#+2]-Prime[#+1]&]

Formula

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

A333253 Lengths of maximal strictly increasing subsequences in the sequence of prime gaps (A001223).

Original entry on oeis.org

2, 2, 2, 3, 2, 1, 3, 1, 2, 1, 2, 3, 1, 2, 3, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 1, 3, 2, 1, 1, 1, 2, 1, 3, 1, 3, 2, 4, 1, 1, 3, 3, 2, 2, 3, 1, 3, 1, 2, 3, 2, 2, 1, 1, 3, 1, 1, 2, 1, 1, 2, 1, 3, 1, 2, 4, 2, 1, 1, 1, 2, 1, 2, 2, 2, 2, 2, 3, 1, 3, 1, 3, 3, 1, 2, 2, 2
Offset: 1

Views

Author

Gus Wiseman, Mar 18 2020

Keywords

Comments

Prime gaps are differences between adjacent prime numbers.

Examples

			The prime gaps split into the following strictly 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), ...
		

Crossrefs

The weakly decreasing version is A333212.
The weakly increasing version is A333215.
The unequal version is A333216.
First differences of A333231 (if its first term is 0).
The strictly decreasing version is A333252.
The equal version is A333254.
Prime gaps are A001223.
Strictly increasing runs of compositions in standard order are A124768.
Positions of strict ascents in the sequence of prime gaps are A258025.

Programs

  • Mathematica
    Length/@Split[Differences[Array[Prime,100]],#1<#2&]//Most

Formula

Partial sums are A333231. The partial sum up to but not including the n-th one is A333382(n).

A333252 Lengths of maximal strictly decreasing subsequences in the sequence of prime gaps (A001223).

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 2, 3, 1, 1, 2, 3, 2, 1, 3, 2, 1, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 2, 2, 1, 2, 3, 1, 3, 1, 2, 2, 1, 1, 2, 2, 1, 2, 1, 2, 2, 2, 1, 3, 1, 3, 2, 1, 2, 2, 2, 2, 1, 2, 2, 1, 3, 3, 1, 1, 2, 2, 1, 1, 2, 3, 2, 3, 2, 2, 2, 2, 2, 1, 3, 1, 3, 1, 2, 1
Offset: 1

Views

Author

Gus Wiseman, Mar 18 2020

Keywords

Comments

Prime gaps are differences between adjacent prime numbers.

Examples

			The prime gaps split into the following strictly decreasing 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,4), (6,2), (10,2), (6), (6,4), (6), ...
		

Crossrefs

The weakly decreasing version is A333212.
The weakly increasing version is A333215.
The unequal version is A333216.
First differences of A333230 (if the first term is 0).
The strictly increasing version is A333253.
The equal version is A333254.
Prime gaps are A001223.
Strictly decreasing runs of compositions in standard order are A124769.
Positions of strict descents in the sequence of prime gaps are A258026.

Programs

  • Mathematica
    Length/@Split[Differences[Array[Prime,100]],#1>#2&]//Most

Formula

Partial sums are A333230. The partial sum up to but not including the n-th one is A333381(n - 1).
Showing 1-10 of 12 results. Next