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

A257570 Rectangular array, read by antidiagonals: d(h,k) = distance between h and k in the tree at A232558, for h >=0, k >= 0.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 01 2015

Keywords

Comments

The distance between h and k is the length of the path from h to k in the tree defined from the root 0 by edges from x to x+1 and x to 2x if x is even, and an edge from x to x+1 if x is odd. This is the tree defined at A232558; it is a subtree of the tree defined at A257569.

Examples

			Northwest corner:
0  1  2  3  3  4  4  5  4  5  5
1  0  1  2  2  3  3  4  3  4  4
2  1  0  1  1  2  2  3  2  3  3
3  2  1  0  2  3  1  2  3  4  4
3  2  1  2  0  1  3  4  1  2  2
4  3  2  3  1  0  4  5  2  3  1
d(4,6) = d(6,4) = 3 counts the edges in the path 6,3,2,4;
d(46,21) = 6 counts the edges in the path 46,23,22,11,10,20,21.
		

Crossrefs

Programs

  • Mathematica
    f[{x_, y_}] := If[EvenQ[x], {y, x/2}, {x - 1, y}];
    g[{x_, y_}] := Drop[FixedPointList[f, {x, y}], -1];
    s[n_] := Reverse[Select[Sort[Flatten[Select[g[{n, 0}], #[[2]] == 0 &]]], # > 0 &]];
    m[h_, k_] := Max[Intersection[s[h], s[k]]];
    j[h_, k_] := Join[Select[s[h], # >= m[h, k] &], Reverse[Select[s[k], # > m[h, k] &]]];
    d[h_, k_] := If[k*h == 0, Length[j[h, k]], -1 + Length[j[h, k]]];
    TableForm[Table[d[h, k], {h, 0, 16}, {k, 0, 16}]]  (* A257570 array *)
    Flatten[Table[d[h - k, k], {h, 0, 20}, {k, 0, h}]  (* A257570 sequence *)]

A257571 Triangular array read by rows: d(h,k) = distance between h and k in the tree at A232558, for h >=0, k = 0..h.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 01 2015

Keywords

Comments

The distance between h and k is the length of the path from h to k in the tree defined from the root 0 by edges from x to x+1 and x to 2x if x is even, and an edge from x to x+1 if x is odd. This is the tree defined at A232558; it is a subtree of the tree defined at A257569.

Examples

			First ten rows:
0
1  0
2  1  0
3  2  1  0
3  2  1  2  0
4  3  2  3  1  0
4  3  2  1  3  4  0
5  4  3  2  4  5  1  0
4  3  2  3  1  2  4  5  0
5  4  3  5  2  3  6  7  1  0
d(6,4) = 3 counts the edges in the path 6,3,2,4;
d(46,21) = 6 counts the edges in the path 46,23,22,11,10,20,21.
		

Crossrefs

Programs

  • Mathematica
    f[{x_, y_}] := f[x, y] = If[EvenQ[x], {y, x/2}, {x - 1, y}];
    g[{x_, y_}] := g[x, y] = Drop[FixedPointList[f, {x, y}], -1];
    s[n_] := s[n] = Reverse[Select[Sort[Flatten[Select[g[{n, 0}], #[[2]] == 0 &]]], # > 0 &]];
    m[h_, k_] := m[h, k] = Max[Intersection[s[h], s[k]]];
    j[h_, k_] := j[h, k] = Join[Select[s[h], # >= m[h, k] &], Reverse[Select[s[k], # > m[h, k] &]]];
    d[h_, k_] := d[h, k] = If[k*h == 0, Length[j[h, k]], -1 + Length[j[h, k]]];
    TableForm[Table[d[h, k], {h, 0, 59}, {k, 0, 59}]];  (* A257570 array *)
    Flatten[Table[d[h - k, k], {h, 0, 59}, {k, 0, h}]]; (* A257570 sequence *)

A253281 Triangular array read by rows: T(h,k) = number of steps from (h,k) to (0,0), where allowable steps are as follows: (x,y) -> (x-r, y) if r > 0, and (x,y) -> (y, r/3) otherwise, where r = x mod 3.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 02 2015

Keywords

Comments

For n >= 3, the number of pairs (h,k) satisfying T(h,k) = n is A078008(n+1) for n >= 0. The number of pairs of the form (h,0) satisfying T(h,0) = n is A253718(n).

Examples

			First ten rows:
0
1  2
1  3  2
3  3  3  4
4  4  3  5  5
4  5  4  5  6  5
3  5  5  5  6  6  4
4  4  5  6  6  6  5  5
4  5  4  6  7  6  5  6  5
5  5  5  5  7  7  5  6  6  6
Row 3 counts the pairs (2,0), (1,1), (0,2), for which the paths are as shown here:
(2,0) -> (0,0) (1 step)
(1,1) -> (0,1) -> (1,0) -> (0,0) (3 steps)
(0,2) -> (2,0) -> (0,0) (2 steps)
		

Crossrefs

Programs

  • Mathematica
    f[{x_, y_}] := If[IntegerQ[x/3], {y, x/3}, {x - Mod[x, 3], y}];
    g[{x_, y_}] := Drop[FixedPointList[f, {x, y}], -1];
    h[{x_, y_}] := -1 + Length[g[{x, y}]];
    t = Table[h[{n - k, k}], {n, 0, 20}, {k, 0, n}];
    TableForm[t] (* A253281 array *)
    Flatten[t]   (* A253281 sequence *)

A253272 Triangular array read by rows: T(h,k) = number of steps from (h,k) to (0,0), where one step is (x,y) -> (x-1, y) if x is odd or (x,y) -> (y, x/2) if x is even, except that (2,0) -> (1,0).

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 01 2015

Keywords

Comments

For n>=3, the number of pairs (h,k) satisfying T(h,k) = n is L(n-1), where L = A000032, the Lucas numbers. The number of such pairs having odd n is L(n-3) for n >= 4, and the number having even n is L(n-2) for n >= 3.
Let c(n,k) be the number of pairs (h,k) satisfying T(h,k) = n; in particular, c(n,0) is the number of integers (pairs of the form (h,0)) satisfying T(h,0) = n. Let p(n) = A000931(n). Then c(n,0) = p(n+3) for n >= 2. More generally, for fixed k >=0, the sequence satisfies the recurrence r(n) = r(n-2) + r(n-3) except for initial terms.
The greatest h for which some (h,k) is n steps from (0,0) is H = A029744(n) for n >= 2, and the only such pair is (H,0).
See A257569 for a very similar array for which the number of pairs (h,k) satisfying T(h,k) = n is F(n), where F = A000045, the Fibonacci numbers.

Examples

			First ten rows:
0
1  2
2  3  3
3  4  4  4
4  5  5  5  5
5  5  6  6  6  6
5  6  6  7  6  7  6
6  6  7  7  7  7  7  7
6  7  7  8  7  8  7  8  7
7  7  8  8  8  8  8  8  8  8
Row 3 counts the pairs (2,0), (1,1), (0,2), for which the paths are as shown here:
(2,0) -> (1,0) -> (0,0) (2 steps)
(1,1) -> (0,1) -> (1,0) -> (0,0) (3 steps)
(0,2) -> (2,0) -> (1,0) -> (0,0) (3 steps)
		

Crossrefs

Programs

  • Mathematica
    f[{x_, y_}] := If[EvenQ[x], {y, x/2}, {x - 1, y}]; f[{2, 0}] = {1, 0};
    g[{x_, y_}] := Drop[FixedPointList[f, {x, y}], -1];
    h[{x_, y_}] := -1 + Length[g[{x, y}]];
    t = Table[h[{n - k, k}], {n, 0, 16}, {k, 0, n}]
    TableForm[t]   (* A253272 array *)
    u = Flatten[t] (* A253272 sequence *)
Showing 1-4 of 4 results.