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.

A206479 Number of terms common to the binary expansions of m and n; a matrix by antidiagonals.

This page as a plain text file.
%I A206479 #12 May 30 2025 01:11:17
%S A206479 1,0,0,1,1,1,0,1,1,0,1,0,2,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,
%T A206479 1,0,1,0,2,1,2,1,2,0,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,2,2,2,0,1,1,1,0,1,
%U A206479 1,0,0,2,2,0,0,1,1,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,0,0,0,0,0,0,0
%N A206479 Number of terms common to the binary expansions of m and n; a matrix by antidiagonals.
%H A206479 Robert Israel, <a href="/A206479/b206479.txt">Table of n, a(n) for n = 1..10000</a> (first 141 antidiagonals, flattened)
%e A206479 Northwest corner (the antidiagonals can be read either SW or NE, since the matrix is symmetric):
%e A206479   1 0 1 0 1 0 1 0 1 0
%e A206479   0 1 1 0 0 1 1 0 0 1
%e A206479   1 1 2 0 1 1 2 0 1 1
%e A206479   0 0 0 1 1 1 1 0 0 0
%e A206479   1 0 1 1 2 1 2 0 1 0
%e A206479   0 1 1 1 1 2 2 0 0 1
%e A206479   1 1 2 1 2 2 3 0 1 1
%e A206479   ...
%e A206479 11 = 1 + 1*2 + 1*8 and 29 = 1 + 1*4 + 1*8 + 1*16, so that T(11,29)=2.
%p A206479 f:= proc(m,n) local M,N,i;
%p A206479    M:= convert(m,base,2);
%p A206479    N:= convert(n,base,2);
%p A206479    add(M[i]*N[i], i=1..min(nops(M),nops(N)))
%p A206479 end proc:
%p A206479 seq(seq(f(i,j-i),i=1..j-1),j=2..16); # _Robert Israel_, May 29 2025
%t A206479 d[n_] := IntegerDigits[n, 2];
%t A206479 t[n_] := Reverse[Array[d, 120][[n]]]
%t A206479 s[n_] := Position[t[n], 1]
%t A206479 t[m_, n_] := Length[Intersection[s[m], s[n]]]
%t A206479 TableForm[Table[t[m, n], {m, 1, 14},
%t A206479   {n, 1, 14}]]  (* A206479 as a matrix *)
%t A206479 Flatten[Table[t[i, n + 1 - i], {n, 1, 14},
%t A206479   {i, 1, n}]]   (* A206479 as a sequence *)
%t A206479 u = Table[t[n - 1, m], {n, 3, 16}, {m, 1, n - 2}];
%t A206479 TableForm[u]    (* A206566 as a triangle *)
%t A206479 Flatten[u]      (* A206566 as a sequence *)
%t A206479 v[n_] := Table[t[k, n + 1], {k, 1, n}]
%t A206479 Table[Count[v[n], 0], {n, 1, 100}]  (* A115478 *)
%Y A206479 Cf. A206566, A115478.
%K A206479 nonn,tabl,base
%O A206479 1,13
%A A206479 _Clark Kimberling_, Feb 09 2012