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.

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.

This page as a plain text file.
%I A257571 #5 May 02 2015 10:16:32
%S A257571 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,
%T A257571 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,
%U A257571 4,5,3,2,6,7,4,5,1,0,5,4,3,2,4,5,1,2
%N 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.
%C A257571 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.
%H A257571 Clark Kimberling, <a href="/A257571/b257571.txt">Table of n, a(n) for n = 1..1000</a>
%e A257571 First ten rows:
%e A257571 0
%e A257571 1  0
%e A257571 2  1  0
%e A257571 3  2  1  0
%e A257571 3  2  1  2  0
%e A257571 4  3  2  3  1  0
%e A257571 4  3  2  1  3  4  0
%e A257571 5  4  3  2  4  5  1  0
%e A257571 4  3  2  3  1  2  4  5  0
%e A257571 5  4  3  5  2  3  6  7  1  0
%e A257571 d(6,4) = 3 counts the edges in the path 6,3,2,4;
%e A257571 d(46,21) = 6 counts the edges in the path 46,23,22,11,10,20,21.
%t A257571 f[{x_, y_}] := f[x, y] = If[EvenQ[x], {y, x/2}, {x - 1, y}];
%t A257571 g[{x_, y_}] := g[x, y] = Drop[FixedPointList[f, {x, y}], -1];
%t A257571 s[n_] := s[n] = Reverse[Select[Sort[Flatten[Select[g[{n, 0}], #[[2]] == 0 &]]], # > 0 &]];
%t A257571 m[h_, k_] := m[h, k] = Max[Intersection[s[h], s[k]]];
%t A257571 j[h_, k_] := j[h, k] = Join[Select[s[h], # >= m[h, k] &], Reverse[Select[s[k], # > m[h, k] &]]];
%t A257571 d[h_, k_] := d[h, k] = If[k*h == 0, Length[j[h, k]], -1 + Length[j[h, k]]];
%t A257571 TableForm[Table[d[h, k], {h, 0, 59}, {k, 0, 59}]];  (* A257570 array *)
%t A257571 Flatten[Table[d[h - k, k], {h, 0, 59}, {k, 0, h}]]; (* A257570 sequence *)
%Y A257571 Cf. A257570, A232558.
%K A257571 nonn,tabl,easy
%O A257571 1,4
%A A257571 _Clark Kimberling_, May 01 2015