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.
%I A226207 #7 Dec 04 2016 19:46:31 %S A226207 0,1,1,2,0,2,2,1,1,2,3,1,0,1,3,3,2,2,2,2,3,3,2,1,0,1,2,3,4,2,1,3,3,1, %T A226207 2,4,4,3,3,3,0,3,3,3,4,4,3,2,1,2,2,1,2,3,4,4,3,2,4,4,0,4,4,2,3,4,4,3, %U A226207 2,4,1,4,4,1,4,2,3,4,5,3,4,4,1,3,0,3 %N A226207 Table by antidiagonals: D(m,n) = Zeckendorf distance between m and n. %C A226207 The Zeckendorf distance between positive integers m and n is defined as follows. Suppose that n = F(i1) + F(i2) + ... F(ij) is the Zeckendorf representation of n, where 1 is represented as F(1), not F(2). Let d(n) = F(i1 - 1) + F(i2 - 1) + ... + F(ij - 1); i.e., the indexes for n are downshifted to form d(n). Starting with any n, the number of arrows in the graph n -> d(n) -> d(d(n)) -> ... -> 1 is the "generation number" of n; write the k-th node as s(k,n). If m and n are positive integers, let K(m) and K(n) be the numbers for which s(K(m),m) = s(K(n),n). This first common ancestor, or root, of m and n is denoted r(m,n). The distance between m and n is D(m,n) = K(m) + K(n). %C A226207 It is helpful to regard m and n as nodes in a "Zeckendorf tree" rooted a 1 with edges given by successive upshifting of indexes of Zeckendorf representations; then D(m,n) is the number of edges from m to n. Equivalently, one can start with the Fibonacci (or rabbit) tree of the positive rational numbers (A226080). Replacing each fraction in the tree by its position when the elements are arranged in the order in which generated gives the Zeckendorf array. Thus, D is not only the Zeckendorf graph metric for positive integers, but is also, isomorphically speaking, a graph metric for the positive rational numbers. %C A226207 Suppose that b(n) and c(n) are sequences of positive integers. Sequences D(b(n),c(n)), with exceptions for first terms in some cases, are indicated here: %C A226207 .... %C A226207 D(b(n),c(n)) ... b(n) ........ c(n) %C A226207 A000012 ........ F(n) ........ F(n+1), consecutive Fibonacci numbers %C A226207 A005408 ........ F(n) ........ L(n), Fibonacci(n) and Lucas(n) %C A226207 A095791 ........ 1 ........... n %C A226207 A000012 ........ A000201(n) .. A001950(n), the Wythoff sequences %C A226207 A226208 ........ n ........... n+1 %C A226207 A226209 ........ n ........... n+2 %C A226207 A226210 ........ n............ F(n) %C A226207 A226211 ........ n............ 2n %C A226207 A226212 ........ n............ floor(n/2) %C A226207 A226213 ........ n............ 2^n %C A226207 A226214 ........ n............ n^2 %C A226207 A226215 ........ n! .......... (n+1)! %H A226207 Clark Kimberling, <a href="/A226207/b226207.txt">Antidiagonals n=1..60, flattened</a> %e A226207 Northwest corner of the distance table, D(m,n), m>=1, n>=1: %e A226207 0 1 2 2 3 3 3 4 4 4 4 4 4 %e A226207 1 0 1 1 2 2 2 3 3 3 3 3 4 %e A226207 2 1 0 2 1 1 3 2 2 2 4 4 3 %e A226207 2 1 2 0 3 3 1 4 4 4 2 2 5 %e A226207 3 2 1 3 0 2 4 1 1 3 5 5 2 %e A226207 3 2 3 1 4 4 0 5 5 5 1 1 6 %e A226207 4 3 2 4 1 3 5 0 2 4 6 6 1 %e A226207 4 3 2 4 1 3 5 2 0 4 6 6 3 %e A226207 4 3 2 4 3 1 5 4 4 0 6 6 5 %e A226207 4 3 4 2 5 5 1 6 6 6 0 2 7 %e A226207 4 3 4 2 5 5 1 6 6 6 2 0 7 %e A226207 5 4 3 5 2 4 6 1 3 5 7 7 0 %e A226207 The distance from 36 to 26 is found here, showing successive downsteps: %e A226207 36 = 34 + 8 + 3 + 1 -> 21 + 5 + 2 -> 13 + 3 + 1 -> 8 + 2 %e A226207 26 = 21 + 5 -> 13 + 3 -> 8 + 2 %e A226207 Thus, D(36,26) = 3 + 2 = 5; i.e. the root of 36 and 26, is 10; it takes 3 downshifts to get from 36 to 10 and 2 downshifts from 26 to 10, hence 5 edges in the Zeckendorf graph metric to get from 36 to 26. %t A226207 zeck[n_Integer] := Block[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, z = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[z, 1]; t = t - Fibonacci[k], AppendTo[z, 0]]; k--]; If[n > 0 && z[[1]] == 0, Rest[z], z]]; d[n1_, n2_] := Module[{z1 = zeck[n1], z2 = zeck[n2]}, Length[z1] + Length[z2] - 2 (NestWhile[# + 1 &, 1, z1[[#]] == z2[[#]] &, 1, Min[{Length[z1], Length[z2]}]] - 1)]; Table[d[m, n], {m, 1, 20}, {n, 1, 20}] // TableForm (* A226207 array *) %t A226207 Flatten[Table[d[k, n + 1 - k], {n, 1, 12}, {k, 1, n}]] (* A226207 sequence *) (* _Peter J. C. Moses_, May 30 2013 *) %Y A226207 Cf. A226080, A000045. %K A226207 nonn,tabl,easy %O A226207 1,4 %A A226207 _Clark Kimberling_, May 31 2013