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

A206566 Triangular array: T(i,j) = number of terms common to the binary expansions of i+1 and j, for j=1,2,3,...,i; i=1,2,3,...

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Feb 09 2012

Keywords

Comments

Row n consists of the first n terms of column n+1 of A206479, and (n-th row sum)=A115478(n+1).

Examples

			First ten rows:
0
1 1
0 0 0
1 0 1 1
0 1 1 1 1
1 1 2 1 2 2
0 0 0 0 0 0 0
1 0 1 0 1 0 1 1
0 1 1 0 0 1 1 1 1
1 1 2 0 1 1 2 1 2 2
		

Crossrefs

Programs

  • Mathematica
    d[n_] := IntegerDigits[n, 2];
    t[n_] := Reverse[Array[d, 120][[n]]]
    s[n_] := Position[t[n], 1]
    t[m_, n_] := Length[Intersection[s[m], s[n]]]
    TableForm[Table[t[m, n], {m, 1, 14},
      {n, 1, 14}]] (* A206479 as a matrix *)
    Flatten[Table[t[i, n + 1 - i], {n, 1, 14},
      {i, 1, n}]]  (* A206479 as a sequence *)
    u = Table[t[n - 1, m], {n, 3, 16}, {m, 1, n - 2}];
    TableForm[u]   (* A206566 as a triangle *)
    Flatten[u]     (* A206566 as a sequence *)
    v[n_] := Table[t[k, n + 1], {k, 1, n}]
    Table[Count[v[n], 0], {n, 1, 100}] (* A115478 *)

A206567 S(m,n) = (number of nonzero terms common to the base 3 expansions of m and n), a symmetric matrix read by antidiagonals.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, Feb 09 2012

Keywords

Comments

Every nonnegative integer occurs infinitely many times in the matrix.

Examples

			Northwest corner:
1 0 0 1 0 0 1 0 0 1 0 0 1
0 1 0 0 1 0 0 1 0 0 1 0 0
0 0 1 1 1 0 0 0 0 0 0 1 1
1 0 1 2 1 0 1 0 0 1 0 1 2
0 1 1 1 2 0 0 1 0 0 1 1 1
0 0 0 0 0 1 1 1 0 0 0 0 0
1 0 0 1 0 1 2 1 0 1 0 0 1
0 1 0 0 1 1 1 2 0 0 1 0 0
0 0 0 0 0 0 0 0 1 1 1 1 1
1 0 0 1 0 0 1 0 1 2 1 1 2
0 1 0 0 1 0 0 1 1 1 2 1 1
0 0 1 1 1 0 0 0 1 1 1 2 2
1 0 1 2 1 0 1 0 1 2 1 2 3
4 = 3 + 1 and 13 = 3^2 + 3 + 1, so S(13,4)=2.
		

Crossrefs

Cf. A160384, A206479 (similar in base 2).

Programs

  • Maple
    S:= proc(m,n) local M,N;
      M:= convert(m,base,3);
      N:= convert(n,base,3);
      convert(zip((s,t) -> `if`(s=t and s <> 0, 1, 0),M,N),`+`);
    end proc:
    seq(seq(S(k,n-k+1),k=1..n),n=1..30); # Robert Israel, Mar 19 2018
  • Mathematica
    d[n_] := IntegerDigits[n, 3];
    t[n_] := Reverse[Array[d, 100][[n]]]
    s[n_, k_] := Position[t[n], k]
    t[m_, n_] := Sum[Length[Intersection[s[m, k], s[n, k]]], {k, 1, 2}]
    TableForm[Table[t[m, n], {m, 1, 24},
      {n, 1, 24}]]  (* A206567 as a matrix *)
    Flatten[Table[t[i, n + 1 - i], {n, 1, 24},
      {i, 1, n}]]   (* A206567 as a sequence *)
  • PARI
    d(n) = Vecrev(digits(n, 3));
    T(n, k) = {my(dn = d(n), dk = d(k), nb = min(#dn, #dk)); sum(i=1, nb, dn[i] && (dn[i] == dk[i]));} \\ Michel Marcus, Mar 19 2018

Formula

Diagonal entries S(n,n) = A160384(n) since all nonzero digits match. - Robert Israel, Mar 18 2018

Extensions

Edited by Robert Israel, Mar 19 2018
Showing 1-2 of 2 results.