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

A229898 Number of c-squarefree numbers (A233564) less than 2^n.

Original entry on oeis.org

0, 1, 2, 5, 8, 13, 24, 37, 56, 83, 140, 205, 306, 439, 632, 983, 1418, 2035, 2886, 4063, 5618, 8369, 11666, 16423, 22716, 31477, 42782, 58385, 82700, 113161, 155028, 210769, 285644, 383687, 514496, 682921, 940326, 1256299, 1687364, 2245691, 2997182, 3955447, 5233314
Offset: 0

Views

Author

Vladimir Shevelev, Dec 19 2013

Keywords

Comments

For n >= 1, a(n) is the total number of compositions of positive integers less than or equal to n with distinct parts (cf. A032020).
For example, numbers of such compositions of 1,2,3,4,5 are 1,1,3,3,5. So a(5)=13.

Crossrefs

Formula

a(n) - a(n-1) = A032020(n).
G.f.: (1/(1 - x)) * Sum_{i>=1} i!*x^(i*(i+1)/2) * Product_{j=1..i} 1/(1 - x^j). - Ilya Gutkovskiy, Apr 04 2017

Extensions

More terms from Peter J. C. Moses, Dec 19-20 2013

A235590 Sum of parts of the form 10...0 with nonnegative number of zeros in binary representation of c-squarefree numbers (A233564) as the corresponding powers of 2.

Original entry on oeis.org

1, 2, 4, 3, 3, 8, 5, 5, 16, 9, 6, 6, 9, 32, 17, 10, 7, 7, 10, 7, 7, 17, 7, 7, 64, 33, 18, 12, 11, 11, 12, 18, 11, 11, 33, 11, 11, 128, 65, 34, 20, 19, 19, 13, 13, 20, 13, 13, 34, 19, 19, 65, 19, 13, 13, 19, 256, 129, 66, 36, 35
Offset: 1

Views

Author

Vladimir Shevelev, Jan 12 2014

Keywords

Comments

Subsequence of A162439.
The number of times of appearances of number k in the sequence is the number of compositions of k into distinct powers of 2, i.e., it is A000120(k)!

Examples

			Let n=17, A233564(17)=37. In binary a concatenation of parts of the form 10...0 which gives 37 is (100)(10)(1). Thus a(17)= 4+2+1 = 7.
		

Crossrefs

Programs

  • Mathematica
    bitPatt[n_]:=bitPatt[n]=Split[IntegerDigits[n,2],#2==0&]; Map[Plus@@(Map[FromDigits[#,2]&,bitPatt[#]])&,Select[Range[300],#==DeleteDuplicates[#]&[bitPatt[#]]&]] (* Peter J. C. Moses, Jan 15 2014 *)

Formula

Let, for k_1>k_2>...>k_r, A233564(n) = 2^k_1 + 2^k_2 +...+ 2^k_r. Then a(n) = 2^(k_1-k_2-1) + 2^(k_2-k_3-1) + 2^(k_(r-1)-k_r-1) + 2^k_r.

A333489 Numbers k such that the k-th composition in standard order is an anti-run (no adjacent equal parts).

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 13, 16, 17, 18, 20, 22, 24, 25, 32, 33, 34, 37, 38, 40, 41, 44, 45, 48, 49, 50, 52, 54, 64, 65, 66, 68, 69, 70, 72, 76, 77, 80, 81, 82, 88, 89, 96, 97, 98, 101, 102, 104, 105, 108, 109, 128, 129, 130, 132, 133, 134, 137, 140, 141
Offset: 1

Views

Author

Gus Wiseman, Mar 28 2020

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The sequence together with the corresponding compositions begins:
    0: ()          33: (5,1)         70: (4,1,2)
    1: (1)         34: (4,2)         72: (3,4)
    2: (2)         37: (3,2,1)       76: (3,1,3)
    4: (3)         38: (3,1,2)       77: (3,1,2,1)
    5: (2,1)       40: (2,4)         80: (2,5)
    6: (1,2)       41: (2,3,1)       81: (2,4,1)
    8: (4)         44: (2,1,3)       82: (2,3,2)
    9: (3,1)       45: (2,1,2,1)     88: (2,1,4)
   12: (1,3)       48: (1,5)         89: (2,1,3,1)
   13: (1,2,1)     49: (1,4,1)       96: (1,6)
   16: (5)         50: (1,3,2)       97: (1,5,1)
   17: (4,1)       52: (1,2,3)       98: (1,4,2)
   18: (3,2)       54: (1,2,1,2)    101: (1,3,2,1)
   20: (2,3)       64: (7)          102: (1,3,1,2)
   22: (2,1,2)     65: (6,1)        104: (1,2,4)
   24: (1,4)       66: (5,2)        105: (1,2,3,1)
   25: (1,3,1)     68: (4,3)        108: (1,2,1,3)
   32: (6)         69: (4,2,1)      109: (1,2,1,2,1)
		

Crossrefs

Anti-runs summing to n are counted by A003242(n).
A triangle counting maximal anti-runs of compositions is A106356.
A triangle counting maximal runs of compositions is A238279 or A238130.
Partitions whose first differences are an anti-run are A238424.
All of the following pertain to compositions in standard order (A066099):
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Strict compositions are ranked by A233564.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],!MatchQ[stc[#],{_,x_,x_,_}]&]

A032020 Number of compositions (ordered partitions) of n into distinct parts.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 11, 13, 19, 27, 57, 65, 101, 133, 193, 351, 435, 617, 851, 1177, 1555, 2751, 3297, 4757, 6293, 8761, 11305, 15603, 24315, 30461, 41867, 55741, 74875, 98043, 130809, 168425, 257405, 315973, 431065, 558327, 751491, 958265, 1277867, 1621273
Offset: 0

Views

Author

Christian G. Bower, Apr 01 1998

Keywords

Comments

Compositions into distinct parts are equivalent to (1,1)-avoiding compositions. - Gus Wiseman, Jun 25 2020
All terms are odd. - Alois P. Heinz, Apr 09 2021

Examples

			a(6) = 11 because 6 = 5+1 = 4+2 = 3+2+1 = 3+1+2 = 2+4 = 2+3+1 = 2+1+3 = 1+5 = 1+3+2 = 1+2+3.
From _Gus Wiseman_, Jun 25 2020: (Start)
The a(0) = 1 through a(7) = 13 strict compositions:
  ()  (1)  (2)  (3)    (4)    (5)    (6)      (7)
                (1,2)  (1,3)  (1,4)  (1,5)    (1,6)
                (2,1)  (3,1)  (2,3)  (2,4)    (2,5)
                              (3,2)  (4,2)    (3,4)
                              (4,1)  (5,1)    (4,3)
                                     (1,2,3)  (5,2)
                                     (1,3,2)  (6,1)
                                     (2,1,3)  (1,2,4)
                                     (2,3,1)  (1,4,2)
                                     (3,1,2)  (2,1,4)
                                     (3,2,1)  (2,4,1)
                                              (4,1,2)
                                              (4,2,1)
(End)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem II, Missouri Journal of Mathematical Sciences, Vol. 16, No. 1, Winter 2004, pp. 12-17.

Crossrefs

Row sums of A241719.
Main diagonal of A261960.
Dominated by A003242 (anti-run compositions).
These compositions are ranked by A233564.
(1,1)-avoiding patterns are counted by A000142.
Numbers with strict prime signature are A130091.
(1,1,1)-avoiding compositions are counted by A232432.
(1,1)-matching compositions are counted by A261982.
Inseparable partitions are counted by A325535.
Patterns matched by compositions are counted by A335456.
Strict permutations of prime indices are counted by A335489.

Programs

  • Maple
    b:= proc(n, i) b(n, i):= `if`(n=0, [1], `if`(i<1, [], zip((x, y)
          -> x+y, b(n, i-1), `if`(i>n, [], [0, b(n-i, i-1)[]]), 0))) end:
    a:= proc(n) local l; l:=b(n, n): add((i-1)! *l[i], i=1..nops(l)) end:
    seq(a(n), n=0..50);  # Alois P. Heinz, Dec 12 2012
    # second Maple program:
    T:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
          `if`(k=0, `if`(n=0, 1, 0), T(n-k, k) +k*T(n-k, k-1)))
        end:
    a:= n-> add(T(n, k), k=0..floor((sqrt(8*n+1)-1)/2)):
    seq(a(n), n=0..60);  # Alois P. Heinz, Sep 04 2015
  • Mathematica
    f[list_]:=Length[list]!; Table[Total[Map[f, Select[IntegerPartitions[n], Sort[#] == Union[#] &]]], {n, 0,30}]
    T[n_, k_] := T[n, k] = If[k<0 || n<0, 0, If[k==0, If[n==0, 1, 0], T[n-k, k] + k*T[n-k, k-1]]]; a[n_] := Sum[T[n, k], {k, 0, Floor[(Sqrt[8*n + 1] - 1) / 2]}]; Table[a[n], {n, 0, 60}] (* Jean-François Alcover, Sep 22 2015, after Alois P. Heinz *)
  • PARI
    N=66;  q='q+O('q^N);
    gf=sum(n=0,N, n!*q^(n*(n+1)/2) / prod(k=1,n, 1-q^k ) );
    Vec(gf)
    /* Joerg Arndt, Oct 20 2012 */
    
  • PARI
    Q(N) = { \\ A008289
      my(q = vector(N)); q[1] = [1, 0, 0, 0];
      for (n = 2, N,
        my(m = (sqrtint(8*n+1) - 1)\2);
        q[n] = vector((1 + (m>>2)) << 2); q[n][1] = 1;
        for (k = 2, m, q[n][k] = q[n-k][k] + q[n-k][k-1]));
      return(q);
    };
    seq(N) = concat(1, apply(q -> sum(k = 1, #q, q[k] * k!), Q(N)));
    seq(43) \\ Gheorghe Coserea, Sep 09 2018

Formula

"AGK" (ordered, elements, unlabeled) transform of 1, 1, 1, 1, ...
G.f.: Sum_{k>=0} k! * x^((k^2+k)/2) / Product_{j=1..k} (1-x^j). - David W. Wilson May 04 2000
a(n) = Sum_{m=1..n} A008289(n,m)*m!. - Geoffrey Critzer, Sep 07 2012

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

A272919 Numbers of the form 2^(n-1)*(2^(n*m)-1)/(2^n-1), n >= 1, m >= 1.

Original entry on oeis.org

1, 2, 3, 4, 7, 8, 10, 15, 16, 31, 32, 36, 42, 63, 64, 127, 128, 136, 170, 255, 256, 292, 511, 512, 528, 682, 1023, 1024, 2047, 2048, 2080, 2184, 2340, 2730, 4095, 4096, 8191, 8192, 8256, 10922, 16383, 16384, 16912, 18724, 32767, 32768, 32896, 34952, 43690, 65535, 65536, 131071
Offset: 1

Views

Author

Ivan Neretin, May 10 2016

Keywords

Comments

In other words, numbers whose binary representation consists of one or more repeating blocks with only one 1 in each block.
Also, fixed points of the permutations A139706 and A139708.
Each a(n) is a term of A064896 multiplied by some power of 2. As such, this sequence must also be a subsequence of A125121.
Also the numbers that uniquely index a Haar graph (i.e., 5 and 6 are not in the sequence since H(5) is isomorphic to H(6)). - Eric W. Weisstein, Aug 19 2017
From Gus Wiseman, Apr 04 2020: (Start)
The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions. This sequence lists all positive integers k such that the k-th composition in standard order is constant. For example, the sequence together with the corresponding constant compositions begins:
0: () 136: (4,4)
1: (1) 170: (2,2,2,2)
2: (2) 255: (1,1,1,1,1,1,1,1)
3: (1,1) 256: (9)
4: (3) 292: (3,3,3)
7: (1,1,1) 511: (1,1,1,1,1,1,1,1,1)
8: (4) 512: (10)
10: (2,2) 528: (5,5)
15: (1,1,1,1) 682: (2,2,2,2,2)
16: (5) 1023: (1,1,1,1,1,1,1,1,1,1)
31: (1,1,1,1,1) 1024: (11)
32: (6) 2047: (1,1,1,1,1,1,1,1,1,1,1)
36: (3,3) 2048: (12)
42: (2,2,2) 2080: (6,6)
63: (1,1,1,1,1,1) 2184: (4,4,4)
64: (7) 2340: (3,3,3,3)
127: (1,1,1,1,1,1,1) 2730: (2,2,2,2,2,2)
128: (8) 4095: (1,1,1,1,1,1,1,1,1,1,1,1)
(End)

Crossrefs

Cf. A137706 (smallest number indexing a new Haar graph).
Compositions in standard order are A066099.
Strict compositions are ranked by A233564.

Programs

  • Maple
    N:= 10^6: # to get all terms <= N
    R:= select(`<=`,{seq(seq(2^(n-1)*(2^(n*m)-1)/(2^n-1), m = 1 .. ilog2(2*N)/n), n = 1..ilog2(2*N))},N):
    sort(convert(R,list)); # Robert Israel, May 10 2016
  • Mathematica
    Flatten@Table[d = Reverse@Divisors[n]; 2^(d - 1)*(2^n - 1)/(2^d - 1), {n, 17}]

Formula

From Gus Wiseman, Apr 04 2020: (Start)
A333381(a(n)) = A027750(n).
For n > 0, A124767(a(n)) = 1.
If n is a power of two, A333628(a(n)) = 0, otherwise = 1.
A333627(a(n)) is a power of 2.
(End)

A124767 Number of level runs for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
For n > 0, a(n) is one more than the number of adjacent unequal terms in the n-th composition in standard order. Also the number of runs in the same composition. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the level runs are 2; 1,1; so a(11) = 2.
The table starts:
  0
  1
  1 1
  1 2 2 1
  1 2 1 2 2 3 2 1
  1 2 2 2 2 2 3 2 2 3 2 3 2 3 2 1
  1 2 2 2 1 3 3 2 2 3 1 2 3 4 3 2 2 3 3 3 3 3 4 3 2 3 2 3 2 3 2 1
The 1234567th composition in standard order is (3,2,1,2,2,1,2,5,1,1,1) with runs ((3),(2),(1),(2,2),(1),(2),(5),(1,1,1)), so a(1234567) = 8. - _Gus Wiseman_, Apr 08 2020
		

Crossrefs

Row-lengths are A011782.
Compositions counted by number of runs are A238279 or A333755.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767 (this sequence).
- Weakly increasing compositions are A225620.
- Strict compositions A233564.
- Constant compositions are A272919.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-run compositions are A333489.
- Runs-resistance is A333628.
- Run-lengths are A333769 (triangle).

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Split[stc[n]]],{n,0,100}] (* Gus Wiseman, Apr 17 2020 *)

Formula

a(0) = 0, a(n) = 1 + Sum_{1<=i=1 0.
For n > 0, a(n) = A333382(n) + 1. - Gus Wiseman, Apr 08 2020

A333217 Numbers k such that the k-th composition in standard order covers an initial interval of positive integers.

Original entry on oeis.org

0, 1, 3, 5, 6, 7, 11, 13, 14, 15, 21, 22, 23, 26, 27, 29, 30, 31, 37, 38, 41, 43, 44, 45, 46, 47, 50, 52, 53, 54, 55, 58, 59, 61, 62, 63, 75, 77, 78, 83, 85, 86, 87, 89, 90, 91, 92, 93, 94, 95, 101, 102, 105, 106, 107, 108, 109, 110, 111, 114, 116, 117, 118
Offset: 1

Views

Author

Gus Wiseman, Mar 15 2020

Keywords

Comments

The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.

Examples

			The sequence of terms together with the corresponding compositions begins:
    0: ()              37: (3,2,1)           75: (3,2,1,1)
    1: (1)             38: (3,1,2)           77: (3,1,2,1)
    3: (1,1)           41: (2,3,1)           78: (3,1,1,2)
    5: (2,1)           43: (2,2,1,1)         83: (2,3,1,1)
    6: (1,2)           44: (2,1,3)           85: (2,2,2,1)
    7: (1,1,1)         45: (2,1,2,1)         86: (2,2,1,2)
   11: (2,1,1)         46: (2,1,1,2)         87: (2,2,1,1,1)
   13: (1,2,1)         47: (2,1,1,1,1)       89: (2,1,3,1)
   14: (1,1,2)         50: (1,3,2)           90: (2,1,2,2)
   15: (1,1,1,1)       52: (1,2,3)           91: (2,1,2,1,1)
   21: (2,2,1)         53: (1,2,2,1)         92: (2,1,1,3)
   22: (2,1,2)         54: (1,2,1,2)         93: (2,1,1,2,1)
   23: (2,1,1,1)       55: (1,2,1,1,1)       94: (2,1,1,1,2)
   26: (1,2,2)         58: (1,1,2,2)         95: (2,1,1,1,1,1)
   27: (1,2,1,1)       59: (1,1,2,1,1)      101: (1,3,2,1)
   29: (1,1,2,1)       61: (1,1,1,2,1)      102: (1,3,1,2)
   30: (1,1,1,2)       62: (1,1,1,1,2)      105: (1,2,3,1)
   31: (1,1,1,1,1)     63: (1,1,1,1,1,1)    106: (1,2,2,2)
		

Crossrefs

Sequences covering an initial interval are counted by A000670.
Composition in standard order are A066099.
The case of strictly increasing initial intervals is A164894.
The case of strictly decreasing initial intervals is A246534.
The case of permutations is A333218.
The weakly increasing version is A333379.
The weakly decreasing version is A333380.

Programs

  • Mathematica
    normQ[m_]:=Or[m=={},Union[m]==Range[Max[m]]];
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],normQ[stc[#]]&]

A228351 Triangle read by rows in which row n lists the compositions (ordered partitions) of n (see Comments lines for definition).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 30 2013

Keywords

Comments

The representation of the compositions (for fixed n) is as lists of parts, the order between individual compositions (for the same n) is (list-)reversed co-lexicographic. - Joerg Arndt, Sep 02 2013
Dropping the "(list-)reversed" in the comment above gives A228525.
The equivalent sequence for partitions is A026792.
This sequence lists (without repetitions) all finite compositions, in such a way that, if [P_1, ..., P_r] denotes the composition occupying the n-th position in the list, then (((2*n/2^(P_1)-1)/2^(P_2)-1)/...)/2^(P_r)-1 = 0. - Lorenzo Sauras Altuzarra, Jan 22 2020
The k-th composition in the list is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, and taking first differences. Reversing again gives A066099, which is described as the standard ordering. Both sequences define a bijective correspondence between nonnegative integers and integer compositions. - Gus Wiseman, Apr 01 2020
It follows from the previous comment that A000120(k) is the length of the k-th composition that is listed by this sequence (recall that A000120(k) is the number of 1's in the binary expansion of k). - Lorenzo Sauras Altuzarra, Sep 29 2020

Examples

			Illustration of initial terms:
-----------------------------------
n  j     Diagram     Composition j
-----------------------------------
.         _
1  1     |_|         1;
.         _ _
2  1     |_  |       2,
2  2     |_|_|       1, 1;
.         _ _ _
3  1     |_    |     3,
3  2     |_|_  |     1, 2,
3  3     |_  | |     2, 1,
3  4     |_|_|_|     1, 1, 1;
.         _ _ _ _
4  1     |_      |   4,
4  2     |_|_    |   1, 3,
4  3     |_  |   |   2, 2,
4  4     |_|_|_  |   1, 1, 2,
4  5     |_    | |   3, 1,
4  6     |_|_  | |   1, 2, 1,
4  7     |_  | | |   2, 1, 1,
4  8     |_|_|_|_|   1, 1, 1, 1;
.
Triangle begins:
[1];
[2],[1,1];
[3],[1,2],[2,1],[1,1,1];
[4],[1,3],[2,2],[1,1,2],[3,1],[1,2,1],[2,1,1],[1,1,1,1];
[5],[1,4],[2,3],[1,1,3],[3,2],[1,2,2],[2,1,2],[1,1,1,2],[4,1],[1,3,1],[2,2,1],[1,1,2,1],[3,1,1],[1,2,1,1],[2,1,1,1],[1,1,1,1,1];
...
For example [1,2] occupies the 5th position in the corresponding list of compositions and indeed (2*5/2^1-1)/2^2-1 = 0. - _Lorenzo Sauras Altuzarra_, Jan 22 2020
12 --binary expansion--> [1,1,0,0] --reverse--> [0,0,1,1] --positions of 1's--> [3,4] --prepend 0--> [0,3,4] --first differences--> [3,1]. - _Lorenzo Sauras Altuzarra_, Sep 29 2020
		

Crossrefs

Row n has length A001792(n-1). Row sums give A001787, n >= 1.
Cf. A000120 (binary weight), A001511, A006519, A011782, A026792, A065120.
A related ranking of finite sets is A048793/A272020.
All of the following consider the k-th row to be the k-th composition, ignoring the coarser grouping by sum.
- Indices of weakly increasing rows are A114994.
- Indices of weakly decreasing rows are A225620.
- Indices of strictly decreasing rows are A333255.
- Indices of strictly increasing rows are A333256.
- Indices of reversed interval rows A164894.
- Indices of interval rows are A246534.
- Indices of strict rows are A233564.
- Indices of constant rows are A272919.
- Indices of anti-run rows are A333489.
- Row k has A124767(k) runs and A333381(k) anti-runs.
- Row k has GCD A326674(k) and LCM A333226(k).
- Row k has Heinz number A333219(k).
Equals A163510+1, termwise.
Cf. A124734 (increasing length, then lexicographic).
Cf. A296774 (increasing length, then reverse lexicographic).
Cf. A337243 (increasing length, then colexicographic).
Cf. A337259 (increasing length, then reverse colexicographic).
Cf. A296773 (decreasing length, then lexicographic).
Cf. A296772 (decreasing length, then reverse lexicographic).
Cf. A337260 (decreasing length, then colexicographic).
Cf. A108244 (decreasing length, then reverse colexicographic).
Cf. A228369 (lexicographic).
Cf. A066099 (reverse lexicographic).
Cf. A228525 (colexicographic).

Programs

  • Haskell
    a228351 n = a228351_list !! (n - 1)
    a228351_list = concatMap a228351_row [1..]
    a228351_row 0 = []
    a228351_row n = a001511 n : a228351_row (n `div` 2^(a001511 n))
    -- Peter Kagey, Jun 27 2016
    
  • Maple
    # Program computing the sequence:
    A228351 := proc(n) local c, k, L, N: L, N := [], [seq(2*r, r = 1 .. n)]: for k in N do c := 0: while k != 0 do if gcd(k, 2) = 2 then k := k/2: c := c+1: else L := [op(L), op(c)]: k := k-1: c := 0: fi: od: od: L[n]: end: # Lorenzo Sauras Altuzarra, Jan 22 2020
    # Program computing the list of compositions:
    List := proc(n) local c, k, L, M, N: L, M, N := [], [], [seq(2*r, r = 1 .. 2^n-1)]: for k in N do c := 0: while k != 0 do if gcd(k, 2) = 2 then k := k/2: c := c+1: else L := [op(L), c]: k := k-1: c := 0: fi: od: M := [op(M), L]: L := []: od: M: end: # Lorenzo Sauras Altuzarra, Jan 22 2020
  • Mathematica
    bpe[n_]:=Join@@Position[Reverse[IntegerDigits[n,2]],1];
    Table[Differences[Prepend[bpe[n],0]],{n,0,30}] (* Gus Wiseman, Apr 01 2020 *)
  • Python
    from itertools import count, islice
    def A228351_gen(): # generator of terms
        for n in count(1):
            k = n
            while k:
                yield (s:=(~k&k-1).bit_length()+1)
                k >>= s
    A228351_list = list(islice(A228351_gen(),30)) # Chai Wah Wu, Jul 17 2023

A333381 Number of maximal anti-runs of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Mar 24 2020

Keywords

Comments

Anti-runs are sequences without any adjacent equal terms.
A composition of n is a finite sequence of positive integers summing to n. The k-th composition in standard order (row k of A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of k, prepending 0, taking first differences, and reversing again.
For n > 0, also one plus the number of adjacent equal pairs in the n-th composition in standard order.

Examples

			The 46th composition in standard order is (2,1,1,2), with maximal anti-runs ((2,1),(1,2)), so a(46) = 2.
		

Crossrefs

Anti-runs summing to n are counted by A003242(n).
A triangle counting maximal anti-runs of compositions is A106356.
A triangle counting maximal runs of compositions is A238279.
Partitions whose first differences are an anti-run are A238424.
All of the following pertain to compositions in standard order (A066099):
- Adjacent equal pairs are counted by A124762.
- Weakly decreasing runs are counted by A124765.
- Weakly increasing runs are counted by A124766.
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Strict compositions are ranked by A233564.
- Constant compositions are ranked by A272919.
- Normal compositions are ranked by A333217.
- Adjacent unequal pairs are counted by A333382.
- Anti-runs are ranked by A333489.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[Length[Split[stc[n],UnsameQ]],{n,0,100}]

Formula

For n > 0, a(n) = A124762(n) + 1.
Showing 1-10 of 155 results. Next