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.

A363164 Square array A(n, k), n, k >= 0, read by antidiagonals; A(n, k) is the greatest nonnegative number whose binary digits appear in order but not necessarily as consecutive digits in the binary expansions of n and k.

This page as a plain text file.
%I A363164 #23 Jul 13 2023 08:37:57
%S A363164 0,0,0,0,1,0,0,1,1,0,0,1,2,1,0,0,1,1,1,1,0,0,1,2,3,2,1,0,0,1,2,1,1,2,
%T A363164 1,0,0,1,2,3,4,3,2,1,0,0,1,1,3,2,2,3,1,1,0,0,1,2,3,2,5,2,3,2,1,0,0,1,
%U A363164 2,1,1,3,3,1,1,2,1,0,0,1,2,3,4,3,6,3,4,3,2,1,0
%N A363164 Square array A(n, k), n, k >= 0, read by antidiagonals; A(n, k) is the greatest nonnegative number whose binary digits appear in order but not necessarily as consecutive digits in the binary expansions of n and k.
%H A363164 Rémy Sigrist, <a href="/A363164/a363164.png">Colored representation of the array for n, k < 2^10</a>
%F A363164 A(n, k) = A(k, n).
%F A363164 A(n, 0) = 0.
%F A363164 A(n, 1) = 1 for any n > 0.
%F A363164 A(n, n) = n.
%e A363164 Table A(n, k) begins:
%e A363164   n\k | 0  1  2  3  4  5  6  7  8  9  10  11  12  13  14  15
%e A363164   ----+-----------------------------------------------------
%e A363164     0 | 0  0  0  0  0  0  0  0  0  0   0   0   0   0   0   0
%e A363164     1 | 0  1  1  1  1  1  1  1  1  1   1   1   1   1   1   1
%e A363164     2 | 0  1  2  1  2  2  2  1  2  2   2   2   2   2   2   1
%e A363164     3 | 0  1  1  3  1  3  3  3  1  3   3   3   3   3   3   3
%e A363164     4 | 0  1  2  1  4  2  2  1  4  4   4   2   4   2   2   1
%e A363164     5 | 0  1  2  3  2  5  3  3  2  5   5   5   3   5   3   3
%e A363164     6 | 0  1  2  3  2  3  6  3  2  3   6   3   6   6   6   3
%e A363164     7 | 0  1  1  3  1  3  3  7  1  3   3   7   3   7   7   7
%e A363164     8 | 0  1  2  1  4  2  2  1  8  4   4   2   4   2   2   1
%e A363164     9 | 0  1  2  3  4  5  3  3  4  9   5   5   4   5   3   3
%e A363164    10 | 0  1  2  3  4  5  6  3  4  5  10   5   6   6   6   3
%e A363164    11 | 0  1  2  3  2  5  3  7  2  5   5  11   3   7   7   7
%e A363164    12 | 0  1  2  3  4  3  6  3  4  4   6   3  12   6   6   3
%e A363164    13 | 0  1  2  3  2  5  6  7  2  5   6   7   6  13   7   7
%e A363164    14 | 0  1  2  3  2  3  6  7  2  3   6   7   6   7  14   7
%e A363164    15 | 0  1  1  3  1  3  3  7  1  3   3   7   3   7   7  15
%o A363164 (PARI) A(n, k) = { my (sn = [0], bn = binary(n), sk = [0], bk = binary(k)); for (i = 1, #bn, sn = setunion(sn, [2*v+bn[i]|v<-sn])); for (i = 1, #bk, sk = setunion(sk, [2*v+bk[i]|v<-sk])); vecmax(setintersect(sn, sk)); }
%Y A363164 See A175466 for a similar sequence.
%Y A363164 Cf. A301983.
%K A363164 nonn,base,tabl
%O A363164 0,13
%A A363164 _Rémy Sigrist_, Jul 07 2023