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

A341839 Square array T(n, k), n, k >= 0, read by antidiagonals; for any number m with runs in binary expansion (r_1, ..., r_j), let R(m) = {r_1 + ... + r_j, r_2 + ... + r_j, ..., r_j}; T(n, k) is the unique number t such that R(t) is the union of R(n) and of R(k).

Original entry on oeis.org

0, 1, 1, 2, 1, 2, 3, 2, 2, 3, 4, 2, 2, 2, 4, 5, 5, 2, 2, 5, 5, 6, 5, 5, 3, 5, 5, 6, 7, 6, 5, 4, 4, 5, 6, 7, 8, 6, 5, 5, 4, 5, 5, 6, 8, 9, 9, 5, 5, 5, 5, 5, 5, 9, 9, 10, 9, 10, 4, 5, 5, 5, 4, 10, 9, 10, 11, 10, 10, 11, 4, 5, 5, 4, 11, 10, 10, 11, 12, 10, 10, 10, 11, 5, 6, 5, 11, 10, 10, 10, 12
Offset: 0

Views

Author

Rémy Sigrist, Feb 21 2021

Keywords

Comments

For any m > 0, R(m) contains the partial sums of the m-th row of A227736; by convention, R(0) = {}.
The underlying idea is to break in an optimal way the runs in binary expansions of n and of k so that they match, hence the relationship with A003188.

Examples

			Array T(n, k) begins:
  n\k|    0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
  ---+-----------------------------------------------------------------
    0|    0   1   2   3   4   5   6   7   8   9  10  11  12  13  14  15
    1|    1   1   2   2   5   5   6   6   9   9  10  10  13  13  14  14
    2|    2   2   2   2   5   5   5   5  10  10  10  10  13  13  13  13
    3|    3   2   2   3   4   5   5   4  11  10  10  11  12  13  13  12
    4|    4   5   5   4   4   5   5   4  11  10  10  11  11  10  10  11
    5|    5   5   5   5   5   5   5   5  10  10  10  10  10  10  10  10
    6|    6   6   5   5   5   5   6   6   9   9  10  10  10  10   9   9
    7|    7   6   5   4   4   5   6   7   8   9  10  11  11  10   9   8
    8|    8   9  10  11  11  10   9   8   8   9  10  11  11  10   9   8
    9|    9   9  10  10  10  10   9   9   9   9  10  10  10  10   9   9
   10|   10  10  10  10  10  10  10  10  10  10  10  10  10  10  10  10
   11|   11  10  10  11  11  10  10  11  11  10  10  11  11  10  10  11
   12|   12  13  13  12  11  10  10  11  11  10  10  11  12  13  13  12
   13|   13  13  13  13  10  10  10  10  10  10  10  10  13  13  13  13
   14|   14  14  13  13  10  10   9   9   9   9  10  10  13  13  14  14
   15|   15  14  13  12  11  10   9   8   8   9  10  11  12  13  14  15
		

Crossrefs

Programs

  • PARI
    T(n,k) = { my (r=[], v=0); while (n||k, my (w=min(valuation(n+n%2,2), valuation(k+k%2,2))); r=concat(w,r); n\=2^w; k\=2^w); for (k=1, #r, v=(v+k%2)*2^r[k]-k%2); v }

Formula

T(n, k) = T(k, n)
T(m, T(n, k)) = T(T(m, n), k).
T(n, n) = n.
T(n, 0) = 0.
A070939(T(n, k)) = max(A070939(n), A070939(k)).
A003188(T(n, k)) = A003188(n) OR A003188(k) (where OR denotes the bitwise OR operator).
T(n, 1) = A042963(ceiling((n+1)/2)).

A341841 Square array T(n, k), n, k >= 0, read by antidiagonals upwards; for any number m with runs in binary expansion (r_1, ..., r_j), let R(m) = {r_1 + ... + r_j, r_2 + ... + r_j, ..., r_j}; T(n, k) is the unique number t such that R(t) equals R(n) minus R(k).

Original entry on oeis.org

0, 1, 0, 2, 0, 0, 3, 3, 0, 0, 4, 3, 0, 1, 0, 5, 4, 0, 1, 1, 0, 6, 4, 7, 0, 1, 0, 0, 7, 7, 7, 7, 0, 0, 0, 0, 8, 7, 7, 6, 0, 0, 3, 1, 0, 9, 8, 7, 6, 1, 0, 3, 2, 1, 0, 10, 8, 8, 7, 1, 0, 3, 3, 2, 0, 0, 11, 11, 8, 8, 0, 0, 3, 3, 3, 3, 0, 0, 12, 11, 8, 9, 15, 0, 0, 2, 3, 3, 0, 1, 0
Offset: 0

Views

Author

Rémy Sigrist, Feb 21 2021

Keywords

Comments

For any m > 0, R(m) contains the partial sums of the m-th row of A227736; by convention, R(0) = {}.
This sequence uses set subtraction, and is related to:
- A003987 which uses set difference,
- A341839 which uses set union,
- A341840 which uses set intersection.

Examples

			Array T(n, k) begins:
  n\k|   0   1   2   3   4   5   6   7  8  9  10  11  12  13  14  15
  ---+--------------------------------------------------------------
    0|   0   0   0   0   0   0   0   0  0  0   0   0   0   0   0   0
    1|   1   0   0   1   1   0   0   1  1  0   0   1   1   0   0   1
    2|   2   3   0   1   1   0   3   2  2  3   0   1   1   0   3   2
    3|   3   3   0   0   0   0   3   3  3  3   0   0   0   0   3   3
    4|   4   4   7   7   0   0   3   3  3  3   0   0   7   7   4   4
    5|   5   4   7   6   1   0   3   2  2  3   0   1   6   7   4   5
    6|   6   7   7   6   1   0   0   1  1  0   0   1   6   7   7   6
    7|   7   7   7   7   0   0   0   0  0  0   0   0   7   7   7   7
    8|   8   8   8   8  15  15  15  15  0  0   0   0   7   7   7   7
    9|   9   8   8   9  14  15  15  14  1  0   0   1   6   7   7   6
   10|  10  11   8   9  14  15  12  13  2  3   0   1   6   7   4   5
   11|  11  11   8   8  15  15  12  12  3  3   0   0   7   7   4   4
   12|  12  12  15  15  15  15  12  12  3  3   0   0   0   0   3   3
   13|  13  12  15  14  14  15  12  13  2  3   0   1   1   0   3   2
   14|  14  15  15  14  14  15  15  14  1  0   0   1   1   0   0   1
   15|  15  15  15  15  15  15  15  15  0  0   0   0   0   0   0   0
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, n) = 0.
T(n, 0) = n.
T(T(n, k), k) = T(n, k).
A070939(T(n, k)) <= A070939(n).
A003188(T(n, k)) = A003188(n) - (A003188(n) AND A003188(k)) (where AND denotes the bitwise AND operator).

A339674 Irregular triangle T(n, k), n, k >= 0, read by rows; for any number m with runs in binary expansion (r_1, ..., r_j), let R(m) = {r_1 + ... + r_j, r_2 + ... + r_j, ..., r_j}; row n corresponds to the numbers k such that R(k) is included in R(n), in ascending order.

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, Feb 21 2021

Keywords

Comments

For any m > 0, R(m) contains the partial sums of the m-th row of A227736; by convention, R(0) = {}.
The underlying idea is to take some or all of the rightmost runs of a number, and possibly merge some of them.
For any n >= 0, the n-th row:
- has 2^A000120(A003188(n)) terms,
- has first term 0 and last term A003817(n),
- has n at position A090079(n),
- corresponds to the distinct terms in n-th row of table A341840.

Examples

			The triangle starts:
    0;
    0, 1;
    0, 1, 2, 3;
    0, 3;
    0, 3, 4, 7;
    0, 1, 2, 3, 4, 5, 6, 7;
    0, 1, 6, 7;
    0, 7;
    0, 7, 8, 15;
    0, 1, 6, 7, 8, 9, 14, 15;
    0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15;
    0, 3, 4, 7, 8, 11, 12, 15;
    0, 3, 12, 15;
    0, 1, 2, 3, 12, 13, 14, 15;
    0, 1, 14, 15;
    0, 15;
    ...
		

Crossrefs

Programs

  • PARI
    See Links section.

Formula

T(n, 0) = 0.
T(n, A090079(n)) = n.
T(n, 2^A000120(A003188(n))-1) = A003817(n).
Showing 1-3 of 3 results.