cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-10 of 17 results. Next

A357135 Take the k-th composition in standard order for each part k of the n-th composition in standard order; then concatenate.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 26 2022

Keywords

Comments

The k-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 k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			Triangle begins:
   0:
   1: 1
   2: 2
   3: 1 1
   4: 1 1
   5: 2 1
   6: 1 2
   7: 1 1 1
   8: 3
   9: 1 1 1
  10: 2 2
  11: 2 1 1
  12: 1 1 1
  13: 1 2 1
  14: 1 1 2
  15: 1 1 1 1
		

Crossrefs

See link for sequences related to standard compositions.
Row n is the A357134(n)-th composition in standard order.
The version for Heinz numbers of partitions is A357139, cf. A003963.
Row sums are A357186, differences A357187.

Programs

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

Formula

Row n is the A357134(n)-th composition in standard order.

A357134 Take the k-th composition in standard order for each part k of the n-th composition in standard order; then set a(n) to be the index (in standard order) of the concatenation.

Original entry on oeis.org

0, 1, 2, 3, 3, 5, 6, 7, 4, 7, 10, 11, 7, 13, 14, 15, 5, 9, 14, 15, 11, 21, 22, 23, 12, 15, 26, 27, 15, 29, 30, 31, 6, 11, 18, 19, 15, 29, 30, 31, 20, 23, 42, 43, 23, 45, 46, 47, 13, 25, 30, 31, 27, 53, 54, 55, 28, 31, 58, 59, 31, 61, 62, 63, 7, 13, 22, 23, 19
Offset: 0

Views

Author

Gus Wiseman, Sep 24 2022

Keywords

Comments

The k-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 k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			The terms together with their corresponding standard compositions begin:
   0: ()
   1: (1)
   2: (2)
   3: (1,1)
   3: (1,1)
   5: (2,1)
   6: (1,2)
   7: (1,1,1)
   4: (3)
   7: (1,1,1)
  10: (2,2)
  11: (2,1,1)
   7: (1,1,1)
  13: (1,2,1)
  14: (1,1,2)
  15: (1,1,1,1)
		

Crossrefs

See link for sequences related to standard compositions.
The version for Heinz numbers of partitions is A003963.
The vertex-degrees are A048896.
The a(n)-th composition in standard order is row n of A357135.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    stcinv[q_]:=Total[2^(Accumulate[Reverse[q]])]/2;
    Table[stcinv[Join@@stc/@stc[n]],{n,0,30}]

Formula

For n > 0, the value n appears A048896(n - 1) times.
Row a(n) of A066099 = row n of A357135.

A358135 Difference of first and last parts of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Oct 31 2022

Keywords

Comments

The k-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 k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Crossrefs

See link for sequences related to standard compositions.
The first and last parts are A065120 and A001511.
This is the first minus last part of row n of A066099.
The version for Heinz numbers of partitions is A243055.
Row sums of A358133.
The partial sums of standard compositions are A358134, adjusted A242628.
A011782 counts compositions.
A333766 and A333768 give max and min in standard compositions, diff A358138.
A351014 counts distinct runs in standard compositions.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[-First[stc[n]]+Last[stc[n]],{n,1,100}]

Formula

a(n) = A001511(n) - A065120(n).

A329396 Numbers k such that the co-Lyndon factorization of the binary expansion of k is uniform.

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, 38, 40, 42, 48, 50, 52, 54, 56, 58, 60, 62, 63, 64, 72, 80, 84, 96, 98, 100, 104, 106, 108, 112, 114, 116, 118, 120, 122, 124, 126, 127, 128, 136, 140, 142, 144, 160, 164, 168, 170, 192
Offset: 1

Views

Author

Gus Wiseman, Nov 13 2019

Keywords

Comments

The co-Lyndon product of two or more finite sequences is defined to be the lexicographically minimal sequence obtainable by shuffling the sequences together. For example, the co-Lyndon product of (231) and (213) is (212313), the product of (221) and (213) is (212213), and the product of (122) and (2121) is (1212122). A co-Lyndon word is a finite sequence that is prime with respect to the co-Lyndon product. Equivalently, a co-Lyndon word is a finite sequence that is lexicographically strictly greater than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into co-Lyndon words, and if these factors are arranged in a certain order, their concatenation is equal to their co-Lyndon product. For example, (1001) has sorted co-Lyndon factorization (1)(100).
A sequence of words is uniform if they all have the same length.

Examples

			The sequence of terms together with their co-Lyndon factorizations begins:
   1:      (1) = (1)
   2:     (10) = (10)
   3:     (11) = (1)(1)
   4:    (100) = (100)
   6:    (110) = (110)
   7:    (111) = (1)(1)(1)
   8:   (1000) = (1000)
  10:   (1010) = (10)(10)
  12:   (1100) = (1100)
  14:   (1110) = (1110)
  15:   (1111) = (1)(1)(1)(1)
  16:  (10000) = (10000)
  20:  (10100) = (10100)
  24:  (11000) = (11000)
  26:  (11010) = (11010)
  28:  (11100) = (11100)
  30:  (11110) = (11110)
  31:  (11111) = (1)(1)(1)(1)(1)
  32: (100000) = (100000)
  36: (100100) = (100)(100)
  38: (100110) = (100)(110)
  40: (101000) = (101000)
  42: (101010) = (10)(10)(10)
		

Crossrefs

Numbers whose binary expansion has uniform Lyndon factorization are A023758.
Numbers whose reversed binary expansion is Lyndon are A328596.
Numbers whose binary expansion is co-Lyndon are A275692.
Numbers whose trimmed binary expansion has Lyndon and co-Lyndon factorizations of equal lengths are A329395.

Programs

  • Mathematica
    colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    colynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[colynfac[Drop[q,i]],Take[q,i]]]@Last[Select[Range[Length[q]],colynQ[Take[q,#]]&]]];
    Select[Range[100],SameQ@@Length/@colynfac[IntegerDigits[#,2]]&]

A329399 Numbers whose reversed binary expansion has uniform Lyndon factorization.

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, 38, 40, 42, 44, 48, 52, 54, 56, 58, 60, 62, 63, 64, 72, 80, 84, 88, 92, 96, 100, 104, 106, 108, 112, 116, 118, 120, 122, 124, 126, 127, 128, 136, 140, 142, 144, 152, 160, 164, 168, 170
Offset: 1

Views

Author

Gus Wiseman, Nov 13 2019

Keywords

Comments

We define the Lyndon product of two or more finite sequences to be the lexicographically maximal sequence obtainable by shuffling the sequences together. For example, the Lyndon product of (231) with (213) is (232131), the product of (221) with (213) is (222131), and the product of (122) with (2121) is (2122121). A Lyndon word is a finite sequence that is prime with respect to the Lyndon product. Equivalently, a Lyndon word is a finite sequence that is lexicographically strictly less than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into Lyndon words, and if these factors are arranged in lexicographically decreasing order, their concatenation is equal to their Lyndon product. For example, (1001) has sorted Lyndon factorization (001)(1).
A sequence of words is uniform if they all have the same length.

Examples

			The sequence of terms together with their reversed binary expansions and Lyndon factorizations begins:
   1:      (1) = (1)
   2:     (01) = (01)
   3:     (11) = (1)(1)
   4:    (001) = (001)
   6:    (011) = (011)
   7:    (111) = (1)(1)(1)
   8:   (0001) = (0001)
  10:   (0101) = (01)(01)
  12:   (0011) = (0011)
  14:   (0111) = (0111)
  15:   (1111) = (1)(1)(1)(1)
  16:  (00001) = (00001)
  20:  (00101) = (00101)
  24:  (00011) = (00011)
  26:  (01011) = (01011)
  28:  (00111) = (00111)
  30:  (01111) = (01111)
  31:  (11111) = (1)(1)(1)(1)(1)
  32: (000001) = (000001)
  36: (001001) = (001)(001)
  38: (011001) = (011)(001)
  40: (000101) = (000101)
  42: (010101) = (01)(01)(01)
  44: (001101) = (001101)
  48: (000011) = (000011)
		

Crossrefs

Numbers whose binary expansion has uniform Lyndon factorization and uniform co-Lyndon factorization are A023758.
Numbers whose reversed binary expansion is Lyndon are A328596.
Numbers whose binary expansion is co-Lyndon are A275692.
Numbers whose trimmed binary expansion has Lyndon and co-Lyndon factorizations of equal lengths are A329395.

Programs

  • Mathematica
    lynQ[q_]:=Array[Union[{q,RotateRight[q,#]}]=={q,RotateRight[q,#]}&,Length[q]-1,1,And];
    lynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[lynfac[Drop[q,i]],Take[q,i]]][Last[Select[Range[Length[q]],lynQ[Take[q,#]]&]]]];
    Select[Range[100],SameQ@@Length/@lynfac[Reverse[IntegerDigits[#,2]]]&]

A329400 Length of the co-Lyndon factorization of the binary expansion of n with the most significant (first) digit removed.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Nov 16 2019

Keywords

Comments

The co-Lyndon product of two or more finite sequences is defined to be the lexicographically minimal sequence obtainable by shuffling the sequences together. For example, the co-Lyndon product of (231) and (213) is (212313), the product of (221) and (213) is (212213), and the product of (122) and (2121) is (1212122). A co-Lyndon word is a finite sequence that is prime with respect to the co-Lyndon product. Equivalently, a co-Lyndon word is a finite sequence that is lexicographically strictly greater than all of its cyclic rotations. Every finite sequence has a unique (orderless) factorization into co-Lyndon words, and if these factors are arranged in a certain order, their concatenation is equal to their co-Lyndon product. For example, (1001) has sorted co-Lyndon factorization (1)(100).

Examples

			Decapitated binary expansions of 1..20 together with their co-Lyndon factorizations:
   1:     () =
   2:    (0) = (0)
   3:    (1) = (1)
   4:   (00) = (0)(0)
   5:   (01) = (0)(1)
   6:   (10) = (10)
   7:   (11) = (1)(1)
   8:  (000) = (0)(0)(0)
   9:  (001) = (0)(0)(1)
  10:  (010) = (0)(10)
  11:  (011) = (0)(1)(1)
  12:  (100) = (100)
  13:  (101) = (10)(1)
  14:  (110) = (110)
  15:  (111) = (1)(1)(1)
  16: (0000) = (0)(0)(0)(0)
  17: (0001) = (0)(0)(0)(1)
  18: (0010) = (0)(0)(10)
  19: (0011) = (0)(0)(1)(1)
  20: (0100) = (0)(100)
		

Crossrefs

The non-"co" version is A211097.
The version involving all digits is A329312.
Lyndon and co-Lyndon compositions are (both) counted by A059966.
Numbers whose reversed binary expansion is Lyndon are A328596.
Numbers whose binary expansion is co-Lyndon are A275692.
Numbers whose decapitated binary expansion is co-Lyndon are A329401.

Programs

  • Mathematica
    colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    colynfac[q_]:=If[Length[q]==0,{},Function[i,Prepend[colynfac[Drop[q,i]],Take[q,i]]]@Last[Select[Range[Length[q]],colynQ[Take[q,#]]&]]];
    Table[If[n==0,0,Length[colynfac[Rest[IntegerDigits[n,2]]]]],{n,30}]

A329401 Numbers whose binary expansion without the most significant (first) digit is a co-Lyndon word.

Original entry on oeis.org

2, 3, 6, 12, 14, 24, 28, 30, 48, 52, 56, 58, 60, 62, 96, 104, 112, 114, 116, 120, 122, 124, 126, 192, 200, 208, 212, 224, 226, 228, 232, 234, 236, 240, 242, 244, 246, 248, 250, 252, 254, 384, 400, 416, 420, 424, 448, 450, 452, 456, 458, 464, 466, 468, 472, 474
Offset: 1

Views

Author

Gus Wiseman, Nov 16 2019

Keywords

Comments

A co-Lyndon word is a finite sequence that is lexicographically strictly greater than all of its cyclic rotations.

Examples

			The sequence of terms together with their binary expansions begins:
    2: (1,0)
    3: (1,1)
    6: (1,1,0)
   12: (1,1,0,0)
   14: (1,1,1,0)
   24: (1,1,0,0,0)
   28: (1,1,1,0,0)
   30: (1,1,1,1,0)
   48: (1,1,0,0,0,0)
   52: (1,1,0,1,0,0)
   56: (1,1,1,0,0,0)
   58: (1,1,1,0,1,0)
   60: (1,1,1,1,0,0)
   62: (1,1,1,1,1,0)
   96: (1,1,0,0,0,0,0)
  104: (1,1,0,1,0,0,0)
  112: (1,1,1,0,0,0,0)
  114: (1,1,1,0,0,1,0)
  116: (1,1,1,0,1,0,0)
  120: (1,1,1,1,0,0,0)
		

Crossrefs

The version involving all digits is A275692.
Binary Lyndon/co-Lyndon words are A001037.
A ranking of binary co-Lyndon words is A329318

Programs

  • Mathematica
    colynQ[q_]:=Array[Union[{RotateRight[q,#],q}]=={RotateRight[q,#],q}&,Length[q]-1,1,And];
    Select[Range[2,100],colynQ[Rest[IntegerDigits[#,2]]]&]

A345253 Maximal Fibonacci tree: Arrangement of the positive integers as labels of a complete binary tree.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 13, 11, 14, 16, 21, 12, 15, 17, 22, 18, 23, 26, 34, 19, 24, 27, 35, 29, 37, 42, 55, 20, 25, 28, 36, 30, 38, 43, 56, 31, 39, 44, 57, 47, 60, 68, 89, 32, 40, 45, 58, 48, 61, 69, 90, 50, 63, 71, 92, 76, 97, 110, 144, 33, 41, 46, 59, 49
Offset: 1

Views

Author

J. Parker Shectman, Jun 12 2021

Keywords

Comments

Every positive integer occurs exactly once, so that, as a sequence, a(n) is a permutation of the positive integers.
Descending from the root node 1, generate tree by outer composition of L(n) = n + F(Finv(n)) and R(n) = n + F(Finv(n) + 1), respectively, according to left or right branching, where F(n) = A000045(n) are the Fibonacci numbers and Finv(n) = A130233(n) is the 'lower' Fibonacci inverse. This produces each number by maximal Fibonacci expansion (cf. example below of Method 2, entry A343152, and links).
(Level of tree): The number of terms in this expansion of n is the level of the tree on which n appears, A112310(n-1) + 1 = A200648(n+1). The number of terms in the expansion of a(n) is floor(log_2(n)) + 1 = A113473(n) = A070939(n) = A029837(n+1).
"Maximal Fibonacci expansion" maximizes the sum of coefficients over all Fibonacci numbers (of positive index), allowing both F(1) = 1 and F(2) = 1. Thus, it is just an expansion and not a representation (like "greedy" and "lazy"), as it "breaks the rule" by using two bits that correspond to elements of equal value, rather than using distinct basis elements (link). This reveals connections to the cf. sequences: Binary strings that emerge in lexicographic order from "maximal Fibonacci gaps" (example), binary trees of the positive integers, and I-D arrays "harvested" from the trees. To define the expansion uniquely, always include F(1), so that the expansion of positive integer n equals F(1) for n = 1 and F(1) prepended to the lazy Fibonacci representation of n-1 for n > 1. Hence, a(1) = 1, and for n > 1, a(n) = A095903(n-1) + 1. The "redundant" expansion arranges the positive integers in the single binary tree {T(n,k)}, rather than the two trees at A255773 and A255774 that result from representation (see link).
(Left-to-right order in tree): Each F(t)-sized block (F(t+1), ..., F(t+2) - 1) of successive positive integers ("Fibonacci cohort" t) appears in right-to-left order in the tree as reordered in A343152, where elements of each cohort appear consecutively (see link).
Descending from the root node 1, generate tree by the inner composition of A026351 and A026352, that is, one plus the sequences of lower and upper Wythoff numbers, A000201 and A001950, respectively, according to left or right branching (see example below of Method 1 and links).
Generate tree from (one plus) the number of (initial) zeros on the positive integers for the outer composition of sequences, A060143 and A060144, respectively, according to left or right branching descending from the identity (c.f example below of Method 3 and links).
The lower Wythoff numbers, A000201, appear exclusively in the 1st, 3rd, 5th, ... right clades of the tree, while the upper Wythoff numbers A001950, appear exclusively in the 2nd, 4th, 6th, ... right clades of the tree. Here, the k-th right clade comprises the nodes at positions 2^(k+1) and 2^k + 1, together with all descendants of the latter (link).
(Duality with tree A232560, and related arrays): Consider the labeled binary trees a(n) = A232560(A059893(n)) and A232560(n) = a(A059893(n)). Labels along maximal straight paths that always branch left in a(n) give rows of array A345252, while labels along maximal straight paths that always branch left in A232560 give rows of array A083047.
Sorting the labels from each successive right clade of the binary tree a(n) gives the successive columns of A083047, while sorting labels from each successive right clade of A232560 gives each successive column of A345252. This makes the trees a(n) and A232560 "blade-duals," blade being a contraction of branch-clade (see entry for A345254 and link). A200648(n)+1 gives the level of the tree on which elements of array first-columns A345252(n,1) and A083047(n,1) appear.
(Palindromes and coincidence of elements): Trees a(n) and A232560 coincide when the sequence of left and right branching is a palindrome: a(A329395(n)) = A232560(A329395(n)). As Kimberling notes (cf. A059893), this happens at fixed points of A059893(n) or, equivalently, at n for which A081242(n) is a palindrome.
The inverse permutation of a(n) as a sequence can be read from a "tetrangle" or "irregular triangle" tableau with F(t) (Fibonacci number) entries on each row t, for t = 1, 2, 3, ..., in which an entry on row t is 2*x the entry x immediately above it on row t-1, if such exists, or otherwise 2*x + 1 the entry x in the corresponding position on row t-2 (thus generating new rows as in A243571 but without sorting the numbers into increasing order, linked reference):
1,
2,
3, 4,
5, 6, 8,
7, 9, 10, 12, 16,
11, 13, 17, 14, 18, 20, 24, 32,
...
With the right-justified tableau substituted by a left-justified tableau, the same procedure yields the inverse permutation for the "minimal Fibonacci tree," A048680(A059893(n)), the "cohort-dual" tree of a(n), where "cohort" t is the F(t)-sized block of successive entries in the tableau (see entry for A345252, linked reference).
(Coincidence of elements): a(A020988(n)) = A048680(A059893(A020988(n))) = A099919(n) and a(A020989(n)) = A048680(A059893(A020989(n))) = A049651(n). Collectively, a(A061547(n)) = A048680(A059893(A061547(n))) = union(A049651(n), A099919(n)).
With two types of duality, the tree forms a quartet of binary-tree arrangements of the positive integers, together with its blade dual A232560, its cohort dual A048680(A059893), and blade dual A048680 of the latter.
Order in the tree is "memory-less": Let a(n) and a(m) label nodes at positions n and m, respectively. Let d1 and d2 be two descending paths, i.e., sequences branching left or right from a starting node. (Nodal positions for the left and right children of the node at position p are given by 2*p and 2*p + 1, resp., and d1 and d2 are compositions of these.) Then a(d1(n)) < a(d2(n)) if and only if a(d1(m)) < a(d2(m)) (linked reference).

Examples

			As a complete binary tree:
                    1
           /                 \
          2                   3
      /       \          /        \
     4         5        6          8
    / \       / \      / \        / \
   7    9    10   13   11   14   16   21
  / \  / \  /  \ /  \ /  \ /  \ /  \ /  \
  ...
By maximal Fibonacci expansion:
                                        F(1)
                      /                                       \
                F(1) + F(2)                               F(1) + F(3)
           /                    \                    /                  \
  F(1) + F(2) + F(3)   F(1) + F(2) + F(4)   F(1) + F(3) + F(4)   F(1) + F(3) + F(5)
  ...
"Fibonacci gaps," or differences between successive indices in maximal Fibonacci expansion above, are A007931(n-1) for n > 1 (see link):
                   *
          /                  \
         1                    2
     /       \           /        \
    11        12        21        22
   /  \      /  \      /  \      /  \
  111  112  121  122  211  212  221  222
  / \  / \  / \  / \  / \  / \  / \  / \
  ...
In examples of the three methods below:
Branch left-right-right down the tree to arrive at nodal position n = 2*(2*(2*1) + 1) + 1 = 11;
Branch right-left-left down the tree to arrive at nodal position n = 2*(2*(2*1 + 1)) = 12.
Tree by inner composition of (one plus) the lower and upper Wythoff sequences, A000201 and A001950 (Method 1):
a(11) = A000201(A001950(A001950(1) + 1) + 1) + 1 = 13.
a(12) = A001950(A000201(A000201(1) + 1) + 1) + 1 = 11.
Tree by (outer) composition of branching functions L(n) = n + F(Finv(n)) and R(n) = n + F(Finv(n) + 1), where F(n) = A000045(n) and Finv(n) = A130233(n) (Method 2):
a(11) = R(R(L(1))) = 13.
a(12) = L(R(R(1))) = 11.
Tree by outer composition of A060143 and A060144 (Wythoff inverse sequences) (Method 3):
a(11) = 13, position of first nonzero in A060144(A060144(A060143(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
a(12) = 11, position of first nonzero in A060143(A060143(A060144(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
		

Crossrefs

Programs

  • Mathematica
    (* For binary tree implementations, see supporting file under LINKS *)
    a[n_] := (x = 0; y = 0; BDn = Reverse[IntegerDigits[n, 2]]; imax = Length[BDn] - 1; For[i = 0, i <= imax, i++, {x, y} = {y + 1, x + y}; If[BDn[[i + 1]] == 1, {x, y} = {y, x + y}]]; y);
    (* Adapted from PARI code of Kevin Ryde *)
  • PARI
    a(n) = my(x=0,y=0); for(i=0,logint(n,2), [x,y]=[y+1,x+y]; if(bittest(n,i), [x,y]=[y,x+y])); y; \\ Kevin Ryde, Jun 19 2021

Formula

a(1) = 1 and for n > 1, a(n) = A095903(n-1) + 1.
a(n) = A232560(A059893(n)).

A357180 First run-length of the n-th composition in standard order.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 24 2022

Keywords

Comments

A composition of n is a finite sequence of positive integers summing to n. The k-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 k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			Composition 87 in standard order is (2,2,1,1,1), so a(87) = 2.
		

Crossrefs

See link for sequences related to standard compositions.
For parts instead of run-lengths we have A065120, last A001511.
The version for Heinz numbers of partitions is A067029, last A071178.
This is the first part of row n of A333769.
For minimal instead of first we have A357138, maximal A357137.
The last instead of first run-length is A357181.
A051903 gives maximal part in prime signature.
A061395 gives maximal prime index.
A124767 counts runs in standard compositions.
A286470 gives maximal difference of prime indices.
A333766 gives maximal part of standard compositions, minimal A333768.
A353847 ranks run-sums of standard compositions.

Programs

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

A357186 Take the k-th composition in standard order for each part k of the n-th composition in standard order, then add up everything.

Original entry on oeis.org

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

Views

Author

Gus Wiseman, Sep 28 2022

Keywords

Comments

The k-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 k, prepending 0, taking first differences, and reversing again. This gives a bijective correspondence between nonnegative integers and integer compositions.

Examples

			Composition 92 in standard order is (2,1,1,3), with compositions ((2),(1),(1),(1,1)) so a(92) = 2 + 1 + 1 + 1 + 1 = 6.
		

Crossrefs

See link for sequences related to standard compositions.
This is the sum of A029837 over the n-th composition in standard order.
Vertex degrees are A133494.
The version for Heinz numbers of partitions is A325033.
Row sums of A357135.
First differences are A357187.

Programs

  • Mathematica
    stc[n_]:=Differences[Prepend[Join @@ Position[Reverse[IntegerDigits[n,2]],1],0]]//Reverse;
    Table[stc/@stc[n]/.List->Plus,{n,0,100}]

Formula

a(n) = A029837(A357134(n)).
Showing 1-10 of 17 results. Next