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.

A344834 Square array T(n, k), n, k >= 0, read by antidiagonals; T(n, k) = (n * 2^max(0, w(k)-w(n))) AND (k * 2^max(0, w(n)-w(k))) (where AND denotes the bitwise AND operator and w = A070939).

Original entry on oeis.org

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

Views

Author

Rémy Sigrist, May 29 2021

Keywords

Comments

In other words, we right pad the binary expansion of the lesser of n and k with zeros (provided it is positive) so that both numbers have the same number of binary digits, and then apply the bitwise AND operator.

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|  0  1  2   2  4   4   4   4  8  8   8   8   8   8   8   8
    2|  0  2  2   2  4   4   4   4  8  8   8   8   8   8   8   8
    3|  0  2  2   3  4   4   6   6  8  8   8   8  12  12  12  12
    4|  0  4  4   4  4   4   4   4  8  8   8   8   8   8   8   8
    5|  0  4  4   4  4   5   4   5  8  8  10  10   8   8  10  10
    6|  0  4  4   6  4   4   6   6  8  8   8   8  12  12  12  12
    7|  0  4  4   6  4   5   6   7  8  8  10  10  12  12  14  14
    8|  0  8  8   8  8   8   8   8  8  8   8   8   8   8   8   8
    9|  0  8  8   8  8   8   8   8  8  9   8   9   8   9   8   9
   10|  0  8  8   8  8  10   8  10  8  8  10  10   8   8  10  10
   11|  0  8  8   8  8  10   8  10  8  9  10  11   8   9  10  11
   12|  0  8  8  12  8   8  12  12  8  8   8   8  12  12  12  12
   13|  0  8  8  12  8   8  12  12  8  9   8   9  12  13  12  13
   14|  0  8  8  12  8  10  12  14  8  8  10  10  12  12  14  14
   15|  0  8  8  12  8  10  12  14  8  9  10  11  12  13  14  15
		

Crossrefs

Cf. A344835 (OR), A344836 (XOR), A344837 (min), A344838 (max), A344839 (absolute difference).

Programs

  • PARI
    T(n,k,op=bitand,w=m->#binary(m)) = { op(n*2^max(0, w(k)-w(n)), k*2^max(0, w(n)-w(k))) }

Formula

T(n, k) = T(k, n).
T(m, T(n, k)) = T(T(m, n), k).
T(n, n) = n.
T(n, 0) = n.
T(n, 1) = A053644(n).