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 17 results. Next

A238279 Triangle read by rows: T(n,k) is the number of compositions of n into nonzero parts with k parts directly followed by a different part, n>=0, 0<=k<=A004523(n-1).

Original entry on oeis.org

1, 1, 2, 2, 2, 3, 4, 1, 2, 10, 4, 4, 12, 14, 2, 2, 22, 29, 10, 1, 4, 26, 56, 36, 6, 3, 34, 100, 86, 31, 2, 4, 44, 148, 200, 99, 16, 1, 2, 54, 230, 374, 278, 78, 8, 6, 58, 322, 680, 654, 274, 52, 2, 2, 74, 446, 1122, 1390, 814, 225, 22, 1, 4, 88, 573, 1796, 2714, 2058, 813, 136, 10, 4, 88, 778, 2694, 4927
Offset: 0

Views

Author

Joerg Arndt and Alois P. Heinz, Feb 22 2014

Keywords

Comments

Same as A238130, with zeros omitted.
Last elements in rows are 1, 1, 2, 2, 1, 4, 2, 1, 6, 2, 1, 8, ... with g.f. -(x^6+x^4-2*x^2-x-1)/(x^6-2*x^3+1).
For n > 0, also the number of compositions of n with k + 1 runs. - Gus Wiseman, Apr 10 2020

Examples

			Triangle starts:
  00:  1;
  01:  1;
  02:  2;
  03:  2,   2;
  04:  3,   4,   1;
  05:  2,  10,   4;
  06:  4,  12,  14,    2;
  07:  2,  22,  29,   10,    1;
  08:  4,  26,  56,   36,    6;
  09:  3,  34, 100,   86,   31,    2;
  10:  4,  44, 148,  200,   99,   16,    1;
  11:  2,  54, 230,  374,  278,   78,    8;
  12:  6,  58, 322,  680,  654,  274,   52,    2;
  13:  2,  74, 446, 1122, 1390,  814,  225,   22,   1;
  14:  4,  88, 573, 1796, 2714, 2058,  813,  136,  10;
  15:  4,  88, 778, 2694, 4927, 4752, 2444,  618,  77,  2;
  16:  5, 110, 953, 3954, 8531, 9930, 6563, 2278, 415, 28, 1;
  ...
Row n=5 is 2, 10, 4 because in the 16 compositions of 5
  ##:  [composition]  no. of changes
  01:  [ 1 1 1 1 1 ]   0
  02:  [ 1 1 1 2 ]   1
  03:  [ 1 1 2 1 ]   2
  04:  [ 1 1 3 ]   1
  05:  [ 1 2 1 1 ]   2
  06:  [ 1 2 2 ]   1
  07:  [ 1 3 1 ]   2
  08:  [ 1 4 ]   1
  09:  [ 2 1 1 1 ]   1
  10:  [ 2 1 2 ]   2
  11:  [ 2 2 1 ]   1
  12:  [ 2 3 ]   1
  13:  [ 3 1 1 ]   1
  14:  [ 3 2 ]   1
  15:  [ 4 1 ]   1
  16:  [ 5 ]   0
there are 2 with no changes, 10 with one change, and 4 with two changes.
		

Crossrefs

Columns k=0-10 give: A000005 (for n>0), 2*A002133, A244714, A244715, A244716, A244717, A244718, A244719, A244720, A244721, A244722.
Row lengths are A004523.
Row sums are A011782.
The version counting adjacent equal parts is A106356.
The version for ascents/descents is A238343.
The version for weak ascents/descents is A333213.
The k-th composition in standard-order has A124762(k) adjacent equal parts, A124767(k) maximal runs, A333382(k) adjacent unequal parts, and A333381(k) maximal anti-runs.

Programs

  • Maple
    b:= proc(n, v) option remember; `if`(n=0, 1, expand(
          add(b(n-i, i)*`if`(v=0 or v=i, 1, x), i=1..n)))
        end:
    T:= n-> (p-> seq(coeff(p, x, i), i=0..degree(p)))(b(n, 0)):
    seq(T(n), n=0..14);
  • Mathematica
    b[n_, v_] := b[n, v] = If[n == 0, 1, Expand[Sum[b[n-i, i]*If[v == 0 || v == i, 1, x], {i, 1, n}]]]; T[n_] := Function[{p}, Table[Coefficient[p, x, i], {i, 0, Exponent[p, x]}]][b[n, 0]]; Table[T[n], {n, 0, 14}] // Flatten (* Jean-François Alcover, Feb 11 2015, after Maple *)
    Table[If[n==0,1,Length[Select[Join@@Permutations/@IntegerPartitions[n],Length[Split[#]]==k+1&]]],{n,0,12},{k,0,If[n==0,0,Floor[2*(n-1)/3]]}] (* Gus Wiseman, Apr 10 2020 *)
  • PARI
    T_xy(max_row) = {my(N=max_row+1, x='x+O('x^N),h=(1+ sum(i=1,N,(x^i-y*x^i)/(1+y*x^i-x^i)))/(1-sum(i=1,N, y*x^i/(1+y*x^i-x^i)))); for(n=0,N-1, print(Vecrev(polcoeff(h,n))))}
    T_xy(16) \\ John Tyler Rascoe, Jul 10 2024

Formula

G.f.: A(x,y) = ( 1 + Sum_{i>0} ((x^i)*(1 - y)/(1 + y*x^i - x^i)) )/( 1 - Sum_{i>0} ((y*x^i)/(1 + y*x^i - x^i)) ). - John Tyler Rascoe, Jul 10 2024

A106356 Triangle T(n,k) 0<=k

Original entry on oeis.org

1, 1, 1, 3, 0, 1, 4, 3, 0, 1, 7, 6, 2, 0, 1, 14, 7, 8, 2, 0, 1, 23, 20, 10, 8, 2, 0, 1, 39, 42, 22, 13, 9, 2, 0, 1, 71, 72, 58, 28, 14, 10, 2, 0, 1, 124, 141, 112, 72, 33, 16, 11, 2, 0, 1, 214, 280, 219, 150, 92, 36, 18, 12, 2, 0, 1, 378, 516, 466, 311, 189, 112, 40, 20, 13, 2, 0, 1
Offset: 1

Views

Author

Christian G. Bower, Apr 29 2005

Keywords

Comments

For n > 0, also the number of compositions of n with k + 1 maximal anti-runs (sequences without adjacent equal terms). - Gus Wiseman, Mar 23 2020

Examples

			T(4,1) = 3 because the compositions of 4 with 1 adjacent equal part are 1+1+2, 2+1+1, 2+2.
Triangle begins:
   1;
   1,  1;
   3,  0,  1;
   4,  3,  0, 1;
   7,  6,  2, 0, 1;
  14,  7,  8, 2, 0, 1;
  23, 20, 10, 8, 2, 0, 1;
  ...
From _Gus Wiseman_, Mar 23 2020 (Start)
Row n = 6 counts the following compositions (empty column shown by dot):
  (6)     (33)    (222)    (11112)  .  (111111)
  (15)    (114)   (1113)   (21111)
  (24)    (411)   (1122)
  (42)    (1131)  (2211)
  (51)    (1221)  (3111)
  (123)   (1311)  (11121)
  (132)   (2112)  (11211)
  (141)           (12111)
  (213)
  (231)
  (312)
  (321)
  (1212)
  (2121)
(End)
		

Crossrefs

Row sums: 2^(n-1)=A000079(n-1). Columns 0-4: A003242, A106357-A106360.
The version counting adjacent unequal parts is A238279.
The k-th composition in standard-order has A124762(k) adjacent equal parts and A333382(k) adjacent unequal parts.
The k-th composition in standard-order has A124767(k) maximal runs and A333381(k) maximal anti-runs.
The version for ascents/descents is A238343.
The version for weak ascents/descents is A333213.

Programs

  • Maple
    b:= proc(n, h, t) option remember;
          if n=0 then `if`(t=0, 1, 0)
        elif t<0 then 0
        else add(b(n-j, j, `if`(j=h, t-1, t)), j=1..n)
          fi
        end:
    T:= (n, k)-> b(n, -1, k):
    seq(seq(T(n, k), k=0..n-1), n=1..15); # Alois P. Heinz, Oct 23 2011
  • Mathematica
    b[n_, h_, t_] := b[n, h, t] = If[n == 0, If[t == 0, 1, 0], If[t<0, 0, Sum[b[n-j, j, If [j == h, t-1, t]], {j, 1, n}]]]; T[n_, k_] := b[n, -1, k]; Table[Table[T[n, k], {k, 0, n-1}], {n, 1, 15}] // Flatten (* Jean-François Alcover, Feb 20 2015, after Alois P. Heinz *)
    Table[Length[Select[Join@@Permutations/@IntegerPartitions[n],n==0||Length[Split[#,#1!=#2&]]==k+1&]],{n,0,12},{k,0,n}] (* Gus Wiseman, Mar 23 2020 *)

A064113 Indices k such that (1/3)*(prime(k)+prime(k+1)+prime(k+2)) is a prime.

Original entry on oeis.org

2, 15, 36, 39, 46, 54, 55, 73, 102, 107, 110, 118, 129, 160, 164, 184, 187, 194, 199, 218, 239, 271, 272, 291, 339, 358, 387, 419, 426, 464, 465, 508, 520, 553, 599, 605, 621, 629, 633, 667, 682, 683, 702, 709, 710, 733, 761, 791, 813, 821, 822, 829, 830
Offset: 1

Views

Author

Jason Earls, Sep 08 2001

Keywords

Comments

n such that d(n) = d(n+1), where d(n) = prime(n+1) - prime(n) = A001223(n).
Of interest because when I generalize it to d(n) = d(n+2), d(n) = d(n+3), etc. I am unable to find any positive number k such that d(n) = d(n+k) has no solution.
From Lei Zhou, Dec 06 2005: (Start)
When (1/3)*(prime(k) + prime(k+1) + prime(k+2)) is prime, then it is equal to prime(k+1).
Also, indices k such that (prime(k)+prime(k+2))/2 = prime(k+1).
The Mathematica program is based on the alternative definition. (End)
Inflection and undulation points of the primes, i.e., positions of zeros in A036263, the second differences of the primes. - Gus Wiseman, Mar 24 2020

Examples

			a(2) = 15 because (p(15)+p(16)+p(17)) = 1/3(47 + 53 + 59) = 53 (prime average of three successive primes).
Splitting the prime gaps into anti-runs gives: (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), ... Then a(n) is the n-th partial sum of the lengths of these anti-runs. - _Gus Wiseman_, Mar 24 2020
		

Crossrefs

Indices of zeros in A036263 (second differences of primes).
Indices (A000720 = primepi) of balanced primes A006562, minus 1.
Cf. A262138.
Complement of A333214.
First differences are A333216.
The version for strict ascents is A258025.
The version for strict descents is A258026.
The version for weak ascents is A333230.
The version for weak descents is A333231.
A triangle for anti-runs of compositions is A106356.
Lengths of maximal runs of prime gaps are A333254.
Anti-runs of compositions in standard order are A333381.

Programs

  • Haskell
    import Data.List (elemIndices)
    a064113 n = a064113_list !! (n-1)
    a064113_list = map (+ 1) $ elemIndices 0 a036263_list
    -- Reinhard Zumkeller, Jan 20 2012
    
  • Mathematica
    ct = 0; Do[If[(Prime[k] + Prime[k + 2] - 2*Prime[k + 1]) == 0, ct++; n[ct] = k], {k, 1, 2000}]; Table[n[k], {k, 1, ct}] (* Lei Zhou, Dec 06 2005 *)
    Join@@Position[Differences[Array[Prime,100],2],0] (* Gus Wiseman, Mar 24 2020 *)
  • PARI
    d(n) = prime(n+1)-prime(n); j=[]; for(n=1,1500, if(d(n)==d(n+1), j=concat(j,n))); j
    
  • PARI
    { n=0; for (m=1, 10^9, if (d(m)==d(m+1), write("b064113.txt", n++, " ", m); if (n==1000, break)) ) } \\ Using d(n) above. - Harry J. Smith, Sep 07 2009
    
  • PARI
    [n | n<-[1..888], !A036263(n)] \\ M. F. Hasler, Oct 15 2024
    
  • PARI
    \\ More efficient for larges range of n:
    A064113_upto(N, n=1, L=List(), q=prime(n+1), d=q-prime(n))={forprime(p=1+q,, if(d==d=p-q, listput(L,n); #LM. F. Hasler, Oct 15 2024
    
  • Python
    from itertools import count, islice
    from sympy import prime, nextprime
    def A064113_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)
    A064113_list = list(islice(A064113_gen(),20)) # Chai Wah Wu, Feb 27 2024

Formula

A036263(a(n)) = 0; A122535(n) = A000040(a(n)); A006562(n) = A000040(a(n) + 1); A181424(n) = A000040(a(n) + 2). - Reinhard Zumkeller, Jan 20 2012
A262138(2*a(n)) = 0. - Reinhard Zumkeller, Sep 12 2015
a(n) = A000720(A006562(n)) - 1, where A000720 = (prime)pi, A006562 = balanced primes. - M. F. Hasler, Oct 15 2024

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.

A333214 Positions of adjacent unequal terms in the sequence of differences between primes.

Original entry on oeis.org

1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 37, 38, 40, 41, 42, 43, 44, 45, 47, 48, 49, 50, 51, 52, 53, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 74, 75
Offset: 1

Views

Author

Gus Wiseman, Mar 15 2020

Keywords

Examples

			The sequence of differences between primes splits into the following runs: (1), (2,2), (4), (2), (4), (2), (4), (6), (2), (6), (4), (2), (4), (6,6), (2), (6), (4), (2), (6), (4), (6).
		

Crossrefs

The version for the Kolakoski sequence is A054353.
Complement of A064113 (the version for adjacent equal terms).
Runs of compositions in standard order are counted by A124767.
A triangle for runs of compositions is A238279.
The version for strict ascents is A258025.
The version for strict descents is A258026.
The version for weak ascents is A333230.
The version for weak descents is A333231.
First differences are A333254 (if the first term is 0).

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+1) - prime(k) != prime(k+2) - prime(k+1).

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

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.

A376602 Inflection and undulation points in the sequence of composite numbers (A002808).

Original entry on oeis.org

1, 3, 5, 7, 9, 11, 14, 15, 16, 18, 20, 21, 22, 25, 27, 29, 32, 33, 34, 37, 38, 39, 41, 43, 44, 45, 48, 50, 52, 53, 54, 57, 60, 61, 62, 65, 66, 67, 68, 69, 72, 74, 76, 78, 80, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 99, 100, 101, 103, 105, 106, 107, 108
Offset: 1

Views

Author

Gus Wiseman, Oct 05 2024

Keywords

Comments

These are points at which the second differences (A073445) are zero.

Examples

			The composite numbers (A002808) are:
  4, 6, 8, 9, 10, 12, 14, 15, 16, 18, 20, 21, 22, 24, 25, 26, 27, 28, 30, 32, 33, ...
with first differences (A073783):
  2, 2, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, 1, 2, 2, 1, 1, 1, 1, 2, 1, 1, 2, ...
with first differences (A073445):
  0, -1, 0, 1, 0, -1, 0, 1, 0, -1, 0, 1, -1, 0, 0, 0, 1, 0, -1, 0, 0, 0, 1, -1, 0, ...
with zeros at (A376602):
  1, 3, 5, 7, 9, 11, 14, 15, 16, 18, 20, 21, 22, 25, 27, 29, 32, 33, 34, 37, 38, ...
		

Crossrefs

Partitions into composite numbers are counted by A023895, factorizations A050370.
For prime instead of composite we have A064113.
These are the positions of zeros in A073445.
For first differences we had A073783, ones A375929, complement A065890.
For concavity in primes we have A258025/A258026, weak A333230/A333231.
For upward concavity (instead of zero) we have A376651, downward A376652.
The complement is A376603.
For composite numbers: A002808 (terms), A073783 (first differences), A073445 (second differences), A376603 (nonzero curvature), A376651 (concave-up), A376652 (concave-down).
For inflection and undulation points: A064113 (prime), A376588 (non-perfect-power), A376591 (squarefree), A376594 (nonsquarefree), A376597 (prime-power), A376600 (non-prime-power).

Programs

  • Mathematica
    Join@@Position[Differences[Select[Range[100],CompositeQ],2],0]

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.
Showing 1-10 of 17 results. Next