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

A233564 c-squarefree numbers: positive integers which in binary are concatenation of distinct parts of the form 10...0 with nonnegative number of zeros.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 8, 9, 12, 16, 17, 18, 20, 24, 32, 33, 34, 37, 38, 40, 41, 44, 48, 50, 52, 64, 65, 66, 68, 69, 70, 72, 80, 81, 88, 96, 98, 104, 128, 129, 130, 132, 133, 134, 137, 140, 144, 145, 152, 160, 161, 176, 192, 194, 196, 200, 208, 256, 257, 258, 260, 261
Offset: 1

Views

Author

Vladimir Shevelev, Dec 13 2013

Keywords

Comments

Number of terms in interval [2^(n-1), 2^n) is the number of compositions of n with distinct parts (cf. A032020). For example, if n=6, then interval [2^5, 2^6) contains 11 terms {32,...,52}. This corresponds to 11 compositions with distinct parts of 6: 6, 5+1, 1+5, 4+2, 2+4, 3+2+1, 3+1+2, 2+3+1, 2+1+3, 1+3+2, 1+2+3.
From Gus Wiseman, Apr 06 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 numbers k such that the k-th composition in standard order is strict. For example, the sequence together with the corresponding strict compositions begins:
0: () 38: (3,1,2) 98: (1,4,2)
1: (1) 40: (2,4) 104: (1,2,4)
2: (2) 41: (2,3,1) 128: (8)
4: (3) 44: (2,1,3) 129: (7,1)
5: (2,1) 48: (1,5) 130: (6,2)
6: (1,2) 50: (1,3,2) 132: (5,3)
8: (4) 52: (1,2,3) 133: (5,2,1)
9: (3,1) 64: (7) 134: (5,1,2)
12: (1,3) 65: (6,1) 137: (4,3,1)
16: (5) 66: (5,2) 140: (4,1,3)
17: (4,1) 68: (4,3) 144: (3,5)
18: (3,2) 69: (4,2,1) 145: (3,4,1)
20: (2,3) 70: (4,1,2) 152: (3,1,4)
24: (1,4) 72: (3,4) 160: (2,6)
32: (6) 80: (2,5) 161: (2,5,1)
33: (5,1) 81: (2,4,1) 176: (2,1,5)
34: (4,2) 88: (2,1,4) 192: (1,7)
37: (3,2,1) 96: (1,6) 194: (1,5,2)
(End)

Examples

			49 in binary has the following parts of the form 10...0 with nonnegative number of  zeros: (1),(1000),(1). Two of them are the same. So it is not in the sequence. On the other hand, 50 has distinct parts (1)(100)(10), thus it is a term.
		

Crossrefs

A subset of A333489 and superset of A333218.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Weighted sum is A029931.
- Partial sums from the right are A048793.
- Sum is A070939.
- Runs are counted by A124767.
- Reversed initial intervals A164894.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are counted by A333381.
- Anti-runs are A333489.

Programs

  • Mathematica
    bitPatt[n_]:=bitPatt[n]=Split[IntegerDigits[n,2],#1>#2||#2==0&];
    Select[Range[0,300],bitPatt[#]==DeleteDuplicates[bitPatt[#]]&] (* Peter J. C. Moses, Dec 13 2013 *)
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],UnsameQ@@stc[#]&] (* Gus Wiseman, Apr 04 2020 *)

Extensions

More terms from Peter J. C. Moses, Dec 13 2013
0 prepended by Gus Wiseman, Apr 04 2020

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

A225620 Indices of partitions in the table of compositions of A228351.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 8, 10, 12, 14, 15, 16, 20, 24, 26, 28, 30, 31, 32, 36, 40, 42, 48, 52, 56, 58, 60, 62, 63, 64, 72, 80, 84, 96, 100, 104, 106, 112, 116, 120, 122, 124, 126, 127, 128, 136, 144, 160, 164, 168, 170, 192, 200, 208, 212, 224, 228, 232, 234, 240, 244, 248, 250, 252, 254, 255
Offset: 1

Views

Author

Omar E. Pol, Aug 03 2013

Keywords

Comments

Also triangle read by rows in which T(n,k) is the decimal representation of a binary number whose mirror represents the k-th partition of n according with the list of juxtaposed reverse-lexicographically ordered partitions of the positive integers (A026792).
In order to construct this sequence as a triangle we use the following rules:
- In the list of A026792 we replace each part of size j of the k-th partition of n by concatenation of j - 1 zeros and only one 1.
- Then replace this new set of parts by the concatenation of its parts.
- Then replace this string by its mirror version which is a binary number.
T(n,k) is the decimal value of this binary number, which represents the k-th partition of n (see example).
The partitions of n are represented by a subsequence with A000041(n) integers starting with 2^(n-1) and ending with 2^n - 1, n >= 1. The odd numbers of the sequence are in A000225.
First differs from A065609 at a(23).
Conjecture: this sequence is a sorted version of b(n) where b(2^k) = 2^k for k >= 0, b(n) = A080100(n)*(2*b(A053645(n)) + 1) otherwise. - Mikhail Kurkov, Oct 21 2023

Examples

			T(6,8) = 58 because 58 in base 2 is 111010 whose mirror is 010111 which is the concatenation of 01, 01, 1, 1, whose number of digits are 2, 2, 1, 1, which are also the 8th partition of 6.
Illustration of initial terms:
The sequence represents a table of partitions (see below):
--------------------------------------------------------
.            Binary                        Partitions
n  k  T(n,k) number  Mirror   Diagram       (A026792)
.                                          1 2 3 4 5 6
--------------------------------------------------------
.                             _
1  1     1       1    1        |           1,
.                             _ _
1  1     2      10    01      _  |           2,
2  2     3      11    11       | |         1,1,
.                             _ _ _
3  1     4     100    001     _ _  |           3,
3  2     6     110    011     _  | |         2,1,
3  3     7     111    111      | | |       1,1,1,
.                             _ _ _ _
4  1     8    1000    0001    _ _    |           4,
4  2    10    1010    0101    _ _|_  |         2,2,
4  3    12    1100    0011    _ _  | |         3,1,
4  4    14    1110    0111    _  | | |       2,1,1,
4  5    15    1111    1111     | | | |     1,1,1,1,
.                             _ _ _ _ _
5  1    16   10000    00001   _ _ _    |           5,
5  2    20   10100    00101   _ _ _|_  |         3,2,
5  3    24   11000    00011   _ _    | |         4,1,
5  4    26   11010    01011   _ _|_  | |       2,2,1,
5  5    28   11100    00111   _ _  | | |       3,1,1,
5  6    30   11110    01111   _  | | | |     2,1,1,1,
5  7    31   11111    11111    | | | | |   1,1,1,1,1,
.                             _ _ _ _ _ _
6  1    32  100000    000001  _ _ _      |           6
6  2    36  100100    001001  _ _ _|_    |         3,3,
6  3    40  101000    000101  _ _    |   |         4,2,
6  4    42  101010    010101  _ _|_ _|_  |       2,2,2,
6  5    48  110000    000011  _ _ _    | |         5,1,
6  6    52  110100    001011  _ _ _|_  | |       3,2,1,
6  7    56  111000    000111  _ _    | | |       4,1,1,
6  8    58  111010    010111  _ _|_  | | |     2,2,1,1,
6  9    60  111100    001111  _ _  | | | |     3,1,1,1,
6  10   62  111110    011111  _  | | | | |   2,1,1,1,1,
6  11   63  111111    111111   | | | | | | 1,1,1,1,1,1,
.
Triangle begins:
  1;
  2,   3;
  4,   6,  7;
  8,  10, 12, 14, 15;
  16, 20, 24, 26, 28, 30, 31;
  32, 36, 40, 42, 48, 52, 56, 58, 60, 62, 63;
  ...
From _Gus Wiseman_, Apr 01 2020: (Start)
Using the encoding of A066099, this sequence ranks all finite nonempty multisets, as follows.
   1: {1}
   2: {2}
   3: {1,1}
   4: {3}
   6: {1,2}
   7: {1,1,1}
   8: {4}
  10: {2,2}
  12: {1,3}
  14: {1,1,2}
  15: {1,1,1,1}
  16: {5}
  20: {2,3}
  24: {1,4}
  26: {1,2,2}
  28: {1,1,3}
  30: {1,1,1,2}
  31: {1,1,1,1,1}
(End)
		

Crossrefs

Column 1 is A000079. Row n has length A000041(n). Right border gives A000225.
The case covering an initial interval is A333379 or A333380.
All of the following pertain to compositions in the order of A066099.
- The weakly increasing version is this sequence.
- The weakly decreasing version is A114994.
- The strictly increasing version is A333255.
- The strictly decreasing version is A333256.
- The unequal version is A233564.
- The equal version is A272919.
- The case covering an initial interval is A333217.
- Initial intervals are ranked by A164894.
- Reversed initial intervals are ranked by A246534.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,100],LessEqual@@stc[#]&] (* Gus Wiseman, Apr 01 2020 *)

Formula

Conjecture: a(A000070(m) - k) = 2^m - A228354(k) for m > 0, 0 < k <= A000041(m). - Mikhail Kurkov, Oct 20 2023

A124766 Number of monotonically increasing runs for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
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. a(n) is the number of maximal weakly increasing runs in this composition. Alternatively, a(n) is one plus the number of strict descents in the same composition. For example, the weakly increasing runs of the 1234567th composition are ((3),(2),(1,2,2),(1,2,5),(1,1,1)), so a(1234567) = 5. The 4 strict descents together with the weak ascents are: 3 > 2 > 1 <= 2 <= 2 > 1 <= 2 <= 5 > 1 <= 1 <= 1. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the increasing runs are 2; 1,1; so a(11) = 2.
The table starts:
  0
  1
  1 1
  1 2 1 1
  1 2 1 2 1 2 1 1
  1 2 2 2 1 2 2 2 1 2 1 2 1 2 1 1
  1 2 2 2 1 3 2 2 1 2 1 2 2 3 2 2 1 2 2 2 1 2 2 2 1 2 1 2 1 2 1 1
		

Crossrefs

Cf. A066099, A124761, A011782 (row lengths).
Compositions of n with k strict descents are A238343.
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 (this sequence).
- Equal runs are counted by A124767.
- Strictly increasing runs are counted by A124768.
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Runs-resistance is A333628.

Programs

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

Formula

a(0) = 0, a(n) = A124761(n) + 1 for n > 0.

A333218 Numbers k such that the k-th composition in standard order is a permutation (of an initial interval).

Original entry on oeis.org

0, 1, 5, 6, 37, 38, 41, 44, 50, 52, 549, 550, 553, 556, 562, 564, 581, 582, 593, 600, 610, 616, 649, 652, 657, 664, 708, 712, 786, 788, 802, 808, 836, 840, 16933, 16934, 16937, 16940, 16946, 16948, 16965, 16966, 16977, 16984, 16994, 17000, 17033, 17036, 17041
Offset: 1

Views

Author

Gus Wiseman, Mar 16 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 their corresponding compositions begins:
        0: ()             593: (3,2,4,1)      16937: (5,4,2,3,1)
        1: (1)            600: (3,2,1,4)      16940: (5,4,2,1,3)
        5: (2,1)          610: (3,1,4,2)      16946: (5,4,1,3,2)
        6: (1,2)          616: (3,1,2,4)      16948: (5,4,1,2,3)
       37: (3,2,1)        649: (2,4,3,1)      16965: (5,3,4,2,1)
       38: (3,1,2)        652: (2,4,1,3)      16966: (5,3,4,1,2)
       41: (2,3,1)        657: (2,3,4,1)      16977: (5,3,2,4,1)
       44: (2,1,3)        664: (2,3,1,4)      16984: (5,3,2,1,4)
       50: (1,3,2)        708: (2,1,4,3)      16994: (5,3,1,4,2)
       52: (1,2,3)        712: (2,1,3,4)      17000: (5,3,1,2,4)
      549: (4,3,2,1)      786: (1,4,3,2)      17033: (5,2,4,3,1)
      550: (4,3,1,2)      788: (1,4,2,3)      17036: (5,2,4,1,3)
      553: (4,2,3,1)      802: (1,3,4,2)      17041: (5,2,3,4,1)
      556: (4,2,1,3)      808: (1,3,2,4)      17048: (5,2,3,1,4)
      562: (4,1,3,2)      836: (1,2,4,3)      17092: (5,2,1,4,3)
      564: (4,1,2,3)      840: (1,2,3,4)      17096: (5,2,1,3,4)
      581: (3,4,2,1)    16933: (5,4,3,2,1)    17170: (5,1,4,3,2)
      582: (3,4,1,2)    16934: (5,4,3,1,2)    17172: (5,1,4,2,3)
		

Crossrefs

A superset of A164894.
Also a superset of A246534.
Not requiring the parts to be distinct gives A333217.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],#==0||UnsameQ@@stc[#]&&Max@@stc[#]==Length[stc[#]]&]

A124768 Number of strictly increasing runs for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
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. a(n) is the number of maximal strictly increasing runs in this composition. Alternatively, a(n) is one plus the number of weak descents in the same composition. For example, the strictly increasing runs of the 1234567th composition are ((3),(2),(1,2),(2),(1,2,5),(1),(1),(1)), so a(1234567) = 8. The 7 weak descents together with the strict ascents are: 3 >= 2 >= 1 < 2 >= 2 >= 1 < 2 < 5 >= 1 >= 1 >= 1. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the strictly increasing runs are 2; 1; 1; so a(11) = 3.
The table starts:
  0
  1
  1 2
  1 2 1 3
  1 2 2 3 1 2 2 4
  1 2 2 3 1 3 2 4 1 2 2 3 2 3 3 5
  1 2 2 3 2 3 2 4 1 2 3 4 2 3 3 5 1 2 2 3 1 3 2 4 2 3 3 4 3 4 4 6
		

Crossrefs

Cf. A066099, A124763, A011782 (row lengths).
Compositions of n with k weak descents are A333213.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Partial sums from the right are A048793.
- 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.
- Strictly increasing runs are counted by A124768 (this sequence).
- Strictly decreasing runs are counted by A124769.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Initial intervals are A246534.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Heinz number is A333219.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are A333489.

Programs

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

Formula

a(0) = 0, a(n) = A124763(n) + 1 for n > 0.

A124765 Number of monotonically decreasing runs for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
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. a(n) is the number of maximal weakly decreasing runs in this composition. Alternatively, a(n) is one plus the number of strict ascents in the same composition. For example, the weakly decreasing runs of the 1234567th composition are ((3,2,1),(2,2,1),(2),(5,1,1,1)), so a(1234567) = 4. The 3 strict ascents together with the weak descents are: 3 >= 2 >= 1 < 2 >= 2 >= 1 < 2 < 5 >= 1 >= 1 >= 1. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the decreasing runs are 2,1,1; so a(11) = 1.
The table starts:
  0
  1
  1 1
  1 1 2 1
  1 1 1 1 2 2 2 1
  1 1 1 1 2 1 2 1 2 2 2 2 2 2 2 1
  1 1 1 1 1 1 2 1 2 2 1 1 2 2 2 1 2 2 2 2 3 2 3 2 2 2 2 2 2 2 2 1
		

Crossrefs

Cf. A066099, A124760, A011782 (row lengths).
Compositions of n with k strict ascents are A238343.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- 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.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are counted by A333381.
- Adjacent unequal pairs are counted by A333382.
- Anti-runs are A333489.
- Runs-resistance is A333628.

Programs

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

Formula

a(0) = 0, a(n) = A124760(n) + 1 for n > 0.

A124769 Number of strictly decreasing runs for compositions in standard order.

Original entry on oeis.org

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

Views

Author

Keywords

Comments

The standard order of compositions is given by A066099.
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. a(n) is the number of maximal strictly decreasing runs in this composition. Alternatively, a(n) is one plus the number of weak ascents in the same composition. For example, the strictly decreasing runs of the 1234567th composition are ((3,2,1),(2),(2,1),(2),(5,1),(1),(1)), so a(1234567) = 7. The 6 weak ascents together with the strict descents are: 3 > 2 > 1 <= 2 <= 2 > 1 <= 2 <= 5 > 1 <= 1 <= 1. - Gus Wiseman, Apr 08 2020

Examples

			Composition number 11 is 2,1,1; the strictly increasing runs are 2,1; 1; so a(11) = 2.
The table starts:
  0
  1
  1 2
  1 1 2 3
  1 1 2 2 2 2 3 4
  1 1 1 2 2 2 2 3 2 2 3 3 3 3 4 5
  1 1 1 2 2 1 2 3 2 2 3 3 2 2 3 4 2 2 2 3 3 3 3 4 3 3 4 4 4 4 5 6
		

Crossrefs

Cf. A066099, A124764, A011782 (row lengths).
Compositions of n with k weak ascents are A333213.
Positions of ones are A333256.
All of the following pertain to compositions in standard order (A066099):
- Length is A000120.
- Partial sums from the right are A048793 (triangle).
- Sum is A070939.
- Weakly decreasing compositions are A114994.
- 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 (this sequence).
- Reversed initial intervals A164894.
- Weakly increasing compositions are A225620.
- Reverse is A228351 (triangle).
- Strict compositions are A233564.
- Constant compositions are A272919.
- Normal compositions are A333217.
- Permutations are A333218.
- Heinz number is A333219.
- Strictly decreasing compositions are A333255.
- Strictly increasing compositions are A333256.
- Anti-runs are A333489.

Programs

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

Formula

a(0) = 0, a(n) = A124764(n) + 1 for n > 0.

A351014 Number of distinct runs in the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Feb 07 2022

Keywords

Comments

The n-th composition in standard order (graded reverse-lexicographic, A066099) is obtained by taking the set of positions of 1's in the reversed binary expansion of n, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The number 3310 has binary expansion 110011101110 and standard composition (1,3,1,1,2,1,1,2), with runs (1), (3), (1,1), (2), (1,1), (2), of which 4 are distinct, so a(3310) = 4.
		

Crossrefs

Counting not necessarily distinct runs gives A124767.
Using binary expansions instead of standard compositions gives A297770.
Positions of first appearances are A351015.
A005811 counts runs in binary expansion.
A011782 counts integer compositions.
A044813 lists numbers whose binary expansion has distinct run-lengths.
A085207 represents concatenation of standard compositions, reverse A085208.
A333489 ranks anti-runs, complement A348612.
A345167 ranks alternating compositions, counted by A025047.
A351204 counts partitions where every permutation has all distinct runs.
Counting words with all distinct runs:
- A351013 = compositions, for run-lengths A329739, ranked by A351290.
- A351016 = binary words, for run-lengths A351017.
- A351018 = binary expansions, for run-lengths A032020, ranked by A175413.
- A351200 = patterns, for run-lengths A351292.
- A351202 = permutations of prime factors.
Selected statistics of standard compositions:
- Length is A000120.
- Sum is A070939.
- Heinz number is A333219.
- Number of distinct parts is A334028.
Selected classes of standard compositions:
- Partitions are A114994, strict A333256.
- Multisets are A225620, strict A333255.
- Strict compositions are A233564.
- Constant compositions are A272919.

Programs

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

A333255 Numbers k such that the k-th composition in standard order is strictly increasing.

Original entry on oeis.org

0, 1, 2, 4, 6, 8, 12, 16, 20, 24, 32, 40, 48, 52, 64, 72, 80, 96, 104, 128, 144, 160, 192, 200, 208, 256, 272, 288, 320, 328, 384, 400, 416, 512, 544, 576, 640, 656, 768, 784, 800, 832, 840, 1024, 1056, 1088, 1152, 1280, 1296, 1312, 1536, 1568, 1600, 1664, 1680
Offset: 1

Views

Author

Gus Wiseman, Mar 20 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 of positive terms together with the corresponding compositions begins:
     1: (1)         128: (8)         656: (2,3,5)
     2: (2)         144: (3,5)       768: (1,9)
     4: (3)         160: (2,6)       784: (1,4,5)
     6: (1,2)       192: (1,7)       800: (1,3,6)
     8: (4)         200: (1,3,4)     832: (1,2,7)
    12: (1,3)       208: (1,2,5)     840: (1,2,3,4)
    16: (5)         256: (9)        1024: (11)
    20: (2,3)       272: (4,5)      1056: (5,6)
    24: (1,4)       288: (3,6)      1088: (4,7)
    32: (6)         320: (2,7)      1152: (3,8)
    40: (2,4)       328: (2,3,4)    1280: (2,9)
    48: (1,5)       384: (1,8)      1296: (2,4,5)
    52: (1,2,3)     400: (1,3,5)    1312: (2,3,6)
    64: (7)         416: (1,2,6)    1536: (1,10)
    72: (3,4)       512: (10)       1568: (1,4,6)
    80: (2,5)       544: (4,6)      1600: (1,3,7)
    96: (1,6)       576: (3,7)      1664: (1,2,8)
   104: (1,2,4)     640: (2,8)      1680: (1,2,3,5)
		

Crossrefs

Strictly increasing runs are counted by A124768.
The normal case is A164894.
The weakly decreasing version is A114994.
The weakly increasing version is A225620.
The unequal version is A233564.
The equal version is A272919.
The strictly decreasing version is A333256.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join@@Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Select[Range[0,1000],Less@@stc[#]&]
Showing 1-10 of 46 results. Next