login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Horizontal para-Fibonacci sequence: says which column of Wythoff array (starting column count at 0) contains n+1.
14

%I #43 Sep 18 2022 14:31:54

%S 0,1,2,0,3,0,1,4,0,1,2,0,5,0,1,2,0,3,0,1,6,0,1,2,0,3,0,1,4,0,1,2,0,7,

%T 0,1,2,0,3,0,1,4,0,1,2,0,5,0,1,2,0,3,0,1,8,0,1,2,0,3,0,1,4,0,1,2,0,5,

%U 0,1,2,0,3,0,1,6,0,1,2,0,3

%N Horizontal para-Fibonacci sequence: says which column of Wythoff array (starting column count at 0) contains n+1.

%C This is probably the same as the "Fibonacci ruler function" mentioned by Knuth. - _N. J. A. Sloane_, Aug 03 2012

%C From _Amiram Eldar_, Mar 10 2021: (Start)

%C a(n) is the number of the trailing zeros in the Zeckendorf representation of (n+1) (A014417).

%C The asymptotic density of the occurrences of k is 1/phi^(k+2), where phi is the golden ratio (A001622).

%C The asymptotic mean of this sequence is phi. (End)

%D D. E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.1.3, p. 82, solution to Problem 179.

%H Reinhard Zumkeller, <a href="/A035614/b035614.txt">Table of n, a(n) for n = 0..10000</a>

%H Casey Mongoven, <a href="http://ami.ektf.hu/uploads/papers/finalpdf/AMI_41_from175to192.pdf">Sonification of multiple Fibonacci-related sequences</a>, Annales Mathematicae et Informaticae, 41 (2013) pp. 175-192.

%H N. J. A. Sloane, <a href="/classic.html#WYTH">Classic Sequences</a>

%F The segment between the first M and the first M+1 is given by the segment before the first M-1.

%F a(n) = A122840(A014417(n + 1)). - _Indranil Ghosh_, Jun 09 2017

%t max = 81; wy = Table[(n-k)*Fibonacci[k] + Fibonacci[k+1]*Floor[ GoldenRatio*(n - k + 1)], {n, 1, max}, {k, 1, n}]; a[n_] := Position[wy, n][[1, 2]]-1; Table[a[n], {n, 1, max}] (* _Jean-François Alcover_, Nov 02 2011 *)

%o (Haskell)

%o a035614 = a122840 . a014417 . (+ 1) -- _Reinhard Zumkeller_, Mar 10 2013

%o (Python)

%o from sympy import fibonacci

%o def a122840(n): return len(str(n)) - len(str(int(str(n)[::-1])))

%o def a014417(n):

%o k=0

%o x=0

%o while n>0:

%o k=0

%o while fibonacci(k)<=n: k+=1

%o x+=10**(k - 3)

%o n-=fibonacci(k - 1)

%o return x

%o def a(n): return a122840(a014417(n + 1)) # _Indranil Ghosh_, Jun 09 2017, after Haskell code by _Reinhard Zumkeller_

%Y Cf. A000045, A001622, A014417, A019586, A035513, A035612, A122840, A139764.

%K nonn,nice,easy

%O 0,3

%A _J. H. Conway_ and _N. J. A. Sloane_