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!)
A226209 Zeckendorf distance between n and n+2. 2

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

%S 2,1,1,3,4,3,5,4,6,6,7,7,4,6,6,8,8,4,9,9,4,6,6,8,8,4,10,10,4,6,6,11,

%T 11,4,6,6,8,8,4,10,10,4,6,6,12,12,4,6,6,8,8,4,13,13,4,6,6,8,8,4,10,10,

%U 4,6,6,12,12,4,6,6,8,8,4,14,14,4,6,6,8,8,4

%N Zeckendorf distance between n and n+2.

%C Zeckendorf distance is defined at A226207.

%H Clark Kimberling, <a href="/A226209/b226209.txt">Table of n, a(n) for n = 1..1000</a>

%e 7 = 5 + 2 -> 3 + 1 -> 2, and 9 = 8 + 1 -> 5 -> 3 -> 2. The total number of Zeckendorf downshifts (i.e., arrows) is 5, so that a(7) = D(7,9) = 5.

%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)]; lst = Map[d[#, # + 2] &, Range[100]] (* _Peter J. C. Moses_, May 30 2013 *)

%Y Cf. A226080, A226207, A226208.

%K nonn,easy

%O 1,1

%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 April 25 08:27 EDT 2024. Contains 371964 sequences. (Running on oeis4.)