login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A226207 Table by antidiagonals: D(m,n) = Zeckendorf distance between m and n. 11

%I #7 Dec 04 2016 19:46:31

%S 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 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 2,4,1,4,4,1,4,2,3,4,5,3,4,4,1,3,0,3

%N Table by antidiagonals: D(m,n) = Zeckendorf distance between m and n.

%C 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 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 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 ....

%C D(b(n),c(n)) ... b(n) ........ c(n)

%C A000012 ........ F(n) ........ F(n+1), consecutive Fibonacci numbers

%C A005408 ........ F(n) ........ L(n), Fibonacci(n) and Lucas(n)

%C A095791 ........ 1 ........... n

%C A000012 ........ A000201(n) .. A001950(n), the Wythoff sequences

%C A226208 ........ n ........... n+1

%C A226209 ........ n ........... n+2

%C A226210 ........ n............ F(n)

%C A226211 ........ n............ 2n

%C A226212 ........ n............ floor(n/2)

%C A226213 ........ n............ 2^n

%C A226214 ........ n............ n^2

%C A226215 ........ n! .......... (n+1)!

%H Clark Kimberling, <a href="/A226207/b226207.txt">Antidiagonals n=1..60, flattened</a>

%e Northwest corner of the distance table, D(m,n), m>=1, n>=1:

%e 0 1 2 2 3 3 3 4 4 4 4 4 4

%e 1 0 1 1 2 2 2 3 3 3 3 3 4

%e 2 1 0 2 1 1 3 2 2 2 4 4 3

%e 2 1 2 0 3 3 1 4 4 4 2 2 5

%e 3 2 1 3 0 2 4 1 1 3 5 5 2

%e 3 2 3 1 4 4 0 5 5 5 1 1 6

%e 4 3 2 4 1 3 5 0 2 4 6 6 1

%e 4 3 2 4 1 3 5 2 0 4 6 6 3

%e 4 3 2 4 3 1 5 4 4 0 6 6 5

%e 4 3 4 2 5 5 1 6 6 6 0 2 7

%e 4 3 4 2 5 5 1 6 6 6 2 0 7

%e 5 4 3 5 2 4 6 1 3 5 7 7 0

%e The distance from 36 to 26 is found here, showing successive downsteps:

%e 36 = 34 + 8 + 3 + 1 -> 21 + 5 + 2 -> 13 + 3 + 1 -> 8 + 2

%e 26 = 21 + 5 -> 13 + 3 -> 8 + 2

%e 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 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 Flatten[Table[d[k, n + 1 - k], {n, 1, 12}, {k, 1, n}]] (* A226207 sequence *) (* _Peter J. C. Moses_, May 30 2013 *)

%Y Cf. A226080, A000045.

%K nonn,tabl,easy

%O 1,4

%A _Clark Kimberling_, May 31 2013

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified July 25 05:51 EDT 2024. Contains 374586 sequences. (Running on oeis4.)