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-6 of 6 results.

A228370 Toothpick sequence from a diagram of compositions of the positive integers (see Comments lines for definition).

Original entry on oeis.org

0, 1, 2, 4, 6, 7, 8, 11, 15, 16, 17, 19, 21, 22, 23, 27, 35, 36, 37, 39, 41, 42, 43, 46, 50, 51, 52, 54, 56, 57, 58, 63, 79, 80, 81, 83, 85, 86, 87, 90, 94, 95, 96, 98, 100, 101, 102, 106, 114, 115, 116, 118, 120, 121, 122, 125, 129, 130, 131, 133, 135, 136, 137, 143, 175
Offset: 0

Views

Author

Omar E. Pol, Aug 21 2013

Keywords

Comments

In order to construct this sequence we use the following rules:
We start in the first quadrant of the square grid with no toothpicks, so a(0) = 0.
If n is odd then at stage n we place the smallest possible number of toothpicks of length 1 connected by their endpoints in horizontal direction starting from the grid point (0, (n+1)/2) such that the x-coordinate of the exposed endpoint of the last toothpick is not equal to the x-coordinate of any outer corner of the structure.
If n is even then at stage n we place toothpicks of length 1 connected by their endpoints in vertical direction, starting from the exposed toothpick endpoint, downward up to touch the structure or up to touch the x-axis.
Note that the number of toothpick of added at stage (n+1)/2 in horizontal direction is also A001511(n) and the number of toothpicks added at stage n/2 in vertical direction is also A006519(n).
The sequence gives the number of toothpicks after n stages. A228371 (the first differences) gives the number of toothpicks added at the n-th stage.
After 2^k stages a new section of the structure is completed, so the structure can be interpreted as a diagram of the 2^(k-1) compositions of k in colexicographic order, if k >= 1 (see A228525). The infinite diagram can be interpreted as a table of compositions of the positive integers.
The equivalent sequence for partitions is A225600.

Examples

			For n = 32 the diagram represents the 16 compositions of 5. The structure has 79 toothpicks, so a(32) = 79. Note that the k-th horizontal line segment has length A001511(k) equals the largest part of the k-th region, and the k-th vertical line segment has length A006519(k) equals the number of parts of the k-th region.
----------------------------------------------------------
.                                    Triangle
Compositions                  of compositions (rows)
of 5          Diagram          and regions (columns)
----------------------------------------------------------
.            _ _ _ _ _
5            _        |                                 5
1+4          _|_      |                               1 4
2+3          _  |     |                             2   3
1+1+3        _|_|_    |                           1 1   3
3+2          _    |   |                         3       2
1+2+2        _|_  |   |                       1 2       2
2+1+2        _  | |   |                     2   1       2
1+1+1+2      _|_|_|_  |                   1 1   1       2
4+1          _      | |                 4               1
1+3+1        _|_    | |               1 3               1
2+2+1        _  |   | |             2   2               1
1+1+2+1      _|_|_  | |           1 1   2               1
3+1+1        _    | | |         3       1               1
1+2+1+1      _|_  | | |       1 2       1               1
2+1+1+1      _  | | | |     2   1       1               1
1+1+1+1+1     | | | | |   1 1   1       1               1
.
Illustration of initial terms (n = 1..16):
.
.                                   _        _
.                   _ _    _ _      _ _      _|_
.       _     _     _      _  |     _  |     _  |
.              |     |      | |      | |      | |
.
.       1      2     4      6        7        8
.
.
.                                            _ _
.                        _         _         _
.     _ _ _    _ _ _     _ _ _     _|_ _     _|_ _
.     _        _    |    _    |    _    |    _    |
.     _|_      _|_  |    _|_  |    _|_  |    _|_  |
.     _  |     _  | |    _  | |    _  | |    _  | |
.      | |      | | |     | | |     | | |     | | |
.
.       11       15        16        17        19
.
.
.                                _ _ _ _    _ _ _ _
.             _        _         _          _      |
.    _ _      _ _      _|_       _|_        _|_    |
.    _  |     _  |     _  |      _  |       _  |   |
.    _|_|_    _|_|_    _|_|_     _|_|_      _|_|_  |
.    _    |   _    |   _    |    _    |     _    | |
.    _|_  |   _|_  |   _|_  |    _|_  |     _|_  | |
.    _  | |   _  | |   _  | |    _  | |     _  | | |
.     | | |    | | |    | | |     | | |      | | | |
.
.      21       22       23        27          35
.
		

Crossrefs

Programs

  • Python
    def A228370(n): return sum(((m:=(i>>1)+1)&-m).bit_length() if i&1 else (m:=i>>1)&-m for i in range(1,n+1)) # Chai Wah Wu, Jul 14 2022

Formula

a(n) = sum_{k=1..n} A228371(k), n >= 1.
a(2n-1) = A005187(n) + A006520(n+1) - A006519(n), n >= 1.
a(2n) = A005187(n) + A006520(n+1), n >= 1.

A228350 Triangle read by rows: T(j,k) is the k-th part in nonincreasing order of the j-th region of the set of compositions (ordered partitions) of n in colexicographic order, if 1<=j<=2^(n-1) and 1<=k<=A006519(j).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 20 2013

Keywords

Comments

Triangle read by rows in which row n lists the A006519(n) elements of the row A001511(n) of triangle A065120, n >= 1.
The equivalent sequence for integer partitions is A206437.

Examples

			---------------------------------------------------------
.              Diagram                Triangle
Compositions     of            of compositions (rows)
.   of 5       regions          and regions (columns)
----------------------------------------------------------
.             _ _ _ _ _
.         5  |_        |                                5
.       1+4  |_|_      |                              1 4
.       2+3  |_  |     |                            2   3
.     1+1+3  |_|_|_    |                          1 1   3
.       3+2  |_    |   |                        3       2
.     1+2+2  |_|_  |   |                      1 2       2
.     2+1+2  |_  | |   |                    2   1       2
.   1+1+1+2  |_|_|_|_  |                  1 1   1       2
.       4+1  |_      | |                4               1
.     1+3+1  |_|_    | |              1 3               1
.     2+2+1  |_  |   | |            2   2               1
.   1+1+2+1  |_|_|_  | |          1 1   2               1
.     3+1+1  |_    | | |        3       1               1
.   1+2+1+1  |_|_  | | |      1 2       1               1
.   2+1+1+1  |_  | | | |    2   1       1               1
. 1+1+1+1+1  |_|_|_|_|_|  1 1   1       1               1
.
Also the structure could be represented by an isosceles triangle in which the n-th diagonal gives the n-th region. For the composition of 4 see below:
.             _ _ _ _
.         4  |_      |                  4
.       1+3  |_|_    |                1   3
.       2+2  |_  |   |              2       2
.     1+1+2  |_|_|_  |            1   1       2
.       3+1  |_    | |          3               1
.     1+2+1  |_|_  | |        1   2               1
.     2+1+1  |_  | | |      2       1               1
.   1+1+1+1  |_|_|_|_|    1   1       1               1
.
Illustration of the four sections of the set of compositions of 4:
.                                      _ _ _ _
.                                     |_      |     4
.                                     |_|_    |   1+3
.                                     |_  |   |   2+2
.                       _ _ _         |_|_|_  | 1+1+2
.                      |_    |   3          | |     1
.             _ _      |_|_  | 1+2          | |     1
.     _      |_  | 2       | |   1          | |     1
.    |_| 1     |_| 1       |_|   1          |_|     1
.
.
Illustration of initial terms. The parts of the eight regions of the set of compositions of 4:
--------------------------------------------------------
\j:  1      2    3        4     5      6    7          8
k
--------------------------------------------------------
.  _    _ _    _    _ _ _     _    _ _    _    _ _ _ _
1 |_|1 |_  |2 |_|1 |_    |3  |_|1 |_  |2 |_|1 |_      |4
2        |_|1        |_  |2         |_|1        |_    |3
3                      | |1                       |   |2
4                      |_|1                       |_  |2
5                                                   | |1
6                                                   | |1
7                                                   | |1
8                                                   |_|1
.
Triangle begins:
1;
2,1;
1;
3,2,1,1;
1;
2,1;
1;
4,3,2,2,1,1,1,1;
1;
2,1;
1;
3,2,1,1;
1;
2,1;
1;
5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1;
...
.
Also triangle read by rows T(n,m) in which row n lists the parts of the n-th section of the set of compositions of the integers >= n, ordered by regions. Row lengths give A045623. Row sums give A001792 (see below):
[1];
[2,1];
[1],[3,2,1,1];
[1],[2,1],[1],[4,3,2,2,1,1,1,1];
[1],[2,1],[1],[3,2,1,1],[1],[2,1],[1],[5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1];
		

Crossrefs

Formula

T(j,k) = A065120(A001511(j)),k) = A001511(j) - A029837(k), 1<=k<=A006519(j), j>=1.

A187816 Triangle read by rows in which row n lists the first 2^(n-1) terms of A006519 in nonincreasing order, n >= 1.

Original entry on oeis.org

1, 2, 1, 4, 2, 1, 1, 8, 4, 2, 2, 1, 1, 1, 1, 16, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 32, 16, 8, 8, 4, 4, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 64, 32, 16, 16, 8, 8, 8, 8, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2
Offset: 1

Views

Author

Omar E. Pol, Sep 10 2013

Keywords

Comments

T(n,k) is also the number of parts in the k-th largest region of the diagram of regions of the set of compositions of n, n >= 1, k >= 1, see example.
Row lengths is A000079.
Row sums give A001792(n-1).

Examples

			For n = 5 the diagram of regions of the set of compositions of 5 has 2^(5-1) regions, see below:
------------------------------------------------------
.          A006519
.         as a tree
.         of number        Diagram
Region    of parts       of regions     Composition
------------------------------------------------------
.                         _ _ _ _ _
1      | 1          |    |_| | | | |    1, 1, 1, 1, 1
2      |   2        |    |_ _| | | |    2, 1, 1, 1
3      | 1          |    |_|   | | |    1, 2, 1, 1
4      |      4     |    |_ _ _| | |    3, 1, 1
5      | 1          |    |_| |   | |    1, 1, 2, 1
6      |   2        |    |_ _|   | |    2, 2, 1
7      | 1          |    |_|     | |    1, 3, 1
8      |        8   |    |_ _ _ _| |    4, 1
9      | 1          |    |_| | |   |    1, 1, 1, 2
10     |   2        |    |_ _| |   |    2, 1, 2
11     | 1          |    |_|   |   |    1, 2, 2
12     |      4     |    |_ _ _|   |    3, 2
13     | 1          |    |_| |     |    1, 1, 3
14     |   2        |    |_ _|     |    2, 3
15     | 1          |    |_|       |    1, 4
16     |         16 |    |_ _ _ _ _|    5
.
The first largest region in the diagram is the 16th region which contains 16 parts, so T(5,1) = 16. The second largest region is the 8th region which contains 8 parts, so T(5,2) = 8. The third and the fourth largest regions are both the 4th region and the 12th region, each contains 4 parts, so T(5,3) = 4 and T(5,4) = 4. And so on. The sequence of the number of parts of the k-th largest region of the diagram is [16, 8, 4, 4, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1], the same as the 5th row of triangle, as shown below.
Triangle begins:
1;
2,1;
4,2,1,1;
8,4,2,2,1,1,1,1;
16,8,4,4,2,2,2,2,1,1,1,1,1,1,1,1;
32,16,8,8,4,4,4,4,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
...
		

Crossrefs

A228349 Triangle read by rows: T(j,k) is the k-th part in nondecreasing order of the j-th region of the set of compositions (ordered partitions) of n in colexicographic order, if 1<=j<=2^(n-1) and 1<=k<=A006519(j).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 26 2013

Keywords

Comments

Triangle read by rows in which row n lists the A006519(n) elements of the row A001511(n) of triangle A090996, n >= 1.
The equivalent sequence for partitions is A220482.

Examples

			----------------------------------------------------------
.             Diagram                Triangle
Compositions    of            of compositions (rows)
of 5          regions          and regions (columns)
----------------------------------------------------------
.            _ _ _ _ _
5           |_        |                                 5
1+4         |_|_      |                               1 4
2+3         |_  |     |                             2   3
1+1+3       |_|_|_    |                           1 1   3
3+2         |_    |   |                         3       2
1+2+2       |_|_  |   |                       1 2       2
2+1+2       |_  | |   |                     2   1       2
1+1+1+2     |_|_|_|_  |                   1 1   1       2
4+1         |_      | |                 4               1
1+3+1       |_|_    | |               1 3               1
2+2+1       |_  |   | |             2   2               1
1+1+2+1     |_|_|_  | |           1 1   2               1
3+1+1       |_    | | |         3       1               1
1+2+1+1     |_|_  | | |       1 2       1               1
2+1+1+1     |_  | | | |     2   1       1               1
1+1+1+1+1   |_|_|_|_|_|   1 1   1       1               1
.
Written as an irregular triangle in which row n lists the parts of the n-th region the sequence begins:
1;
1,2;
1;
1,1,2,3;
1;
1,2;
1;
1,1,1,1,2,2,3,4;
1;
1,2;
1;
1,1,2,3;
1;
1,2;
1;
1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,5;
...
Alternative interpretation of this sequence:
Triangle read by rows in which row r lists the regions of the last section of the set of compositions of r:
[1];
[1,2];
[1],[1,1,2,3];
[1],[1,2],[1],[1,1,1,1,2,2,3,4];
[1],[1,2],[1],[1,1,2,3],[1],[1,2],[1],[1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,5];
		

Crossrefs

Main triangle: Right border gives A001511. Row j has length A006519(j). Row sums give A038712.

Programs

  • Mathematica
    Table[Map[Length@ TakeWhile[IntegerDigits[#, 2], # == 1 &] &, Range[2^(# - 1), 2^# - 1]] &@ IntegerExponent[2 n, 2], {n, 32}] // Flatten (* Michael De Vlieger, May 23 2017 *)

A228347 Triangle of regions and compositions of the positive integers (see Comments lines for definition).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 26 2013

Keywords

Comments

Triangle read by rows in which row n lists A129760(n) zeros followed by the A006519(n) elements of the row A001511(n) of triangle A090996, n >= 1.
The equivalent sequence for partitions is A186114.

Examples

			----------------------------------------------------------
.             Diagram                Triangle
Compositions    of            of compositions (rows)
of 5          regions          and regions (columns)
----------------------------------------------------------
.            _ _ _ _ _
5           |_        |                                 5
1+4         |_|_      |                               1 4
2+3         |_  |     |                             2 0 3
1+1+3       |_|_|_    |                           1 1 0 3
3+2         |_    |   |                         3 0 0 0 2
1+2+2       |_|_  |   |                       1 2 0 0 0 2
2+1+2       |_  | |   |                     2 0 1 0 0 0 2
1+1+1+2     |_|_|_|_  |                   1 1 0 1 0 0 0 2
4+1         |_      | |                 4 0 0 0 0 0 0 0 1
1+3+1       |_|_    | |               1 3 0 0 0 0 0 0 0 1
2+2+1       |_  |   | |             2 0 2 0 0 0 0 0 0 0 1
1+1+2+1     |_|_|_  | |           1 1 0 2 0 0 0 0 0 0 0 1
3+1+1       |_    | | |         3 0 0 0 1 0 0 0 0 0 0 0 1
1+2+1+1     |_|_  | | |       1 2 0 0 0 1 0 0 0 0 0 0 0 1
2+1+1+1     |_  | | | |     2 0 1 0 0 0 1 0 0 0 0 0 0 0 1
1+1+1+1+1   |_|_|_|_|_|   1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1
.
For the positive integer k consider the first 2^(k-1) rows of triangle, as shown below. The positive terms of the n-th row are the parts of the n-th region of the diagram of regions of the set of compositions of k. The positive terms of the n-th column are the parts of the n-th composition of k, with compositions in colexicographic order.
Triangle begins:
1;
1,2;
0,0,1;
1,1,2,3;
0,0,0,0,1;
0,0,0,0,1,2;
0,0,0,0,0,0,1;
1,1,1,1,2,2,3,4;
0,0,0,0,0,0,0,0,1;
0,0,0,0,0,0,0,0,1,2;
0,0,0,0,0,0,0,0,0,0,1;
0,0,0,0,0,0,0,0,1,1,2,3;
0,0,0,0,0,0,0,0,0,0,0,0,1;
0,0,0,0,0,0,0,0,0,0,0,0,1,2;
0,0,0,0,0,0,0,0,0,0,0,0,0,0,1;
1,1,1,1,1,1,1,1,2,2,2,2,3,3,4,5;
...
		

Crossrefs

Mirror of A228348. Column 1 is A036987. Also column 1 gives A209229, n >= 1. Right border gives A001511. Positive terms give A228349.

A228348 Triangle of regions and compositions of the positive integers (see Comments lines for definition).

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Aug 21 2013

Keywords

Comments

Triangle read by rows in which row n lists the A006519(n) elements of the row A001511(n) of triangle A065120 followed by A129760(n) zeros, n >= 1.
The equivalent sequence for integer partitions is A193870.

Examples

			----------------------------------------------------------
.             Diagram                Triangle
Compositions    of            of compositions (rows)
of 5          regions          and regions (columns)
----------------------------------------------------------
.            _ _ _ _ _
5           |_        |                                 5
1+4         |_|_      |                               1 4
2+3         |_  |     |                             2 0 3
1+1+3       |_|_|_    |                           1 1 0 3
3+2         |_    |   |                         3 0 0 0 2
1+2+2       |_|_  |   |                       1 2 0 0 0 2
2+1+2       |_  | |   |                     2 0 1 0 0 0 2
1+1+1+2     |_|_|_|_  |                   1 1 0 1 0 0 0 2
4+1         |_      | |                 4 0 0 0 0 0 0 0 1
1+3+1       |_|_    | |               1 3 0 0 0 0 0 0 0 1
2+2+1       |_  |   | |             2 0 2 0 0 0 0 0 0 0 1
1+1+2+1     |_|_|_  | |           1 1 0 2 0 0 0 0 0 0 0 1
3+1+1       |_    | | |         3 0 0 0 1 0 0 0 0 0 0 0 1
1+2+1+1     |_|_  | | |       1 2 0 0 0 1 0 0 0 0 0 0 0 1
2+1+1+1     |_  | | | |     2 0 1 0 0 0 1 0 0 0 0 0 0 0 1
1+1+1+1+1   |_|_|_|_|_|   1 1 0 1 0 0 0 1 0 0 0 0 0 0 0 1
.
For the positive integer k consider the first 2^(k-1) rows of triangle, as shown below. The positive terms of the n-th row are the parts of the n-th region of the diagram of regions of the set of compositions of k. The positive terms of the n-th diagonal are the parts of the n-th composition of k, with compositions in colexicographic order.
Triangle begins:
1;
2,1;
1,0,0;
3,2,1,1;
1,0,0,0,0;
2,1,0,0,0,0;
1,0,0,0,0,0,0;
4,3,2,2,1,1,1,1;
1,0,0,0,0,0,0,0,0;
2,1,0,0,0,0,0,0,0,0;
1,0,0,0,0,0,0,0,0,0,0;
3,2,1,1,0,0,0,0,0,0,0,0;
1,0,0,0,0,0,0,0,0,0,0,0,0;
2,1,0,0,0,0,0,0,0,0,0,0,0,0;
1,0,0,0,0,0,0,0,0,0,0,0,0,0,0;
5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1;
...
		

Crossrefs

Mirror of A228347. Column 1 is A001511. Right border gives A036987. Also right border gives A209229, n >= 1. Positive terms give A228350.
Showing 1-6 of 6 results.