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.

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

Original entry on oeis.org

0, 2, 6, 8, 15, 17, 21, 23, 35, 37, 41, 43, 50, 52, 56, 58, 79, 81, 85, 87, 94, 96, 100, 102, 114, 116, 120, 122, 129, 131, 135, 137, 175, 177, 181, 183, 190, 192, 196, 198, 210, 212, 216, 218, 225, 227, 231, 233, 254, 256, 260, 262, 269, 271, 275
Offset: 0

Views

Author

Omar E. Pol, Aug 22 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.
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) 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. Then 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.
The sequence gives the number of toothpicks after n stages. A228367 (the first differences) gives the number of toothpicks added at the n-th stage.
Note that the number of toothpick of added at n-th stage in horizontal direction is also A001511(n) and the number of toothpicks added at n-th stage in vertical direction is also A006519(n). Also counting both the x-axis and the y-axis we have that A001511(n) is also the largest part of the n-th region of the diagram and A006519(n) is also the number of parts of the n-th region of the diagram.
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.

Examples

			Illustration of initial terms (n = 1..8):
.                                                _ _ _ _
.                                        _       _      |
.                                _ _     _|_     _|_    |
.                        _       _  |    _  |    _  |   |
.                _ _ _   _|_ _   _|_|_   _|_|_   _|_|_  |
.          _     _    |  _    |  _    |  _    |  _    | |
.    _ _   _|_   _|_  |  _|_  |  _|_  |  _|_  |  _|_  | |
._   _  |  _  |  _  | |  _  | |  _  | |  _  | |  _  | | |
. |   | |   | |   | | |   | | |   | | |   | | |   | | | |
.
.2    6     8      15      17      21      23       35
.
After 16 stages there are 79 toothpicks in the structure which represents the compositions of 5 in colexicographic order as shown below:
-------------------------------
n     Diagram      Composition
-------------------------------
.     _ _ _ _ _
16    _        |   5
15    _|_      |   1+4
14    _  |     |   2+3
13    _|_|_    |   1+1+3
12    _    |   |   3+2
11    _|_  |   |   1+2+2
10    _  | |   |   2+1+2
9     _|_|_|_  |   1+1+1+2
8     _      | |   4+1
7     _|_    | |   1+3+1
6     _  |   | |   2+2+1
5     _|_|_  | |   1+1+2+1
4     _    | | |   3+1+1
3     _|_  | | |   1+2+1+1
2     _  | | | |   2+1+1+1
1      | | | | |   1+1+1+1+1
.
		

Crossrefs

Programs

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

Formula

a(n) = sum_{k=1..n} (A001511(k) + A006519(k)), n >= 1.
a(n) = A005187(n) + A065120(n-1), n >= 1.
a(n) = A228370(2n).

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.

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.