A104326 Dual Zeckendorf representation of n or the maximal (binary) Fibonacci representation. Also list of binary vectors not containing 00.
0, 1, 10, 11, 101, 110, 111, 1010, 1011, 1101, 1110, 1111, 10101, 10110, 10111, 11010, 11011, 11101, 11110, 11111, 101010, 101011, 101101, 101110, 101111, 110101, 110110, 110111, 111010, 111011, 111101, 111110, 111111, 1010101
Offset: 0
Examples
As a sum of Fibonacci numbers (A000045) [using 1 at most once], 13 is 13=8+5=8+3+2. The largest set here is 8+3+2 or, in base Fibonacci, 10110 so a(13)=10110(fib). The Zeckendorf representation would be the smallest set or {13}=100000(fib).
Links
- N. J. A. Sloane, Table of n, a(n) for n = 0..28655
- J. L. Brown, Jr., A new characterization of the Fibonacci numbers, Fibonacci Quarterly 3, no. 1 (1965) 1-8.
- Eric DuchĂȘne, Aviezri S. Fraenkel, Vladimir Gurvich, Nhan Bao Ho, Clark Kimberling, and Urban Larsson, Wythoff Wisdom, 43 pages, no date, apparently unpublished. See Table 2.
- Eric DuchĂȘne, Aviezri S. Fraenkel, Vladimir Gurvich, Nhan Bao Ho, Clark Kimberling, and Urban Larsson, Wythoff Wisdom, unpublished, no date [Cached copy, with permission]
- Ron Knott, Using Fibonacci Numbers to Represent Whole Numbers.
Crossrefs
Programs
-
Maple
dualzeckrep:=proc(n)local i,z;z:=zeckrep(n);i:=1; while i<=nops(z)-2 do if z[i]=1 and z[i+1]=0 and z[i+2]=0 then z[i]:=0; z[i+1]:=1;z[i+2]:=1; if i>3 then i:=i-2 fi else i:=i+1 fi od; if z[1]=0 then z:=subsop(1=NULL,z) fi; z end proc: seq(dualzeckrep(n),n=0..20) ; # alternative A104326 := proc(n) local L,itr,rec,i ; # first compute the usual Zeckendorf rep as in A014417 L := convert(A014417(n),base,10) ; for itr from 1 do rec := false ; # try to recombine 001 -> 110 for i from 3 to nops(L) do if op(i,L) = 1 and op(i-1,L) =0 and op(i-2,L) =0 then rec := true ; L := subsop(i=0,L) ; L := subsop(i-1=1,L) ; L := subsop(i-2=1,L) ; end if; end do: if op(-1,L) = 0 then L := subsop(-1=NULL,L) ; end if; if rec = false then break ; end if; end do: add( op(i,L)*10^(i-1),i=1..nops(L)) ; end proc: seq(A104326(n),n=0..20) ; # R. J. Mathar, Aug 28 2025
-
Mathematica
fb[n_] := Module[{k = Ceiling[Log[GoldenRatio, n*Sqrt[5]]], t = n, fr = {}}, While[k > 1, If[t >= Fibonacci[k], AppendTo[fr, 1]; t = t - Fibonacci[k], AppendTo[fr, 0]]; k--]; fr]; a[n_] := Module[{v = fb[n]}, nv = Length[v]; i = 1; While[i <= nv - 2, If[v[[i]] == 1 && v[[i + 1]] == 0 && v[[i + 2]] == 0, v[[i]] = 0; v[[i + 1]] = 1; v[[i + 2]] = 1; If[i > 2, i -= 3]]; i++]; i = Position[v, ?(# > 0 &)]; If[i == {}, 0, FromDigits[v[[i[[1, 1]] ;; -1]]]]]; Array[a, 34, 0] (* _Amiram Eldar, Oct 31 2019 after Robert G. Wilson v at A014417 and the Maple code *) Map[FromDigits, Select[IntegerString[Range[0, 255], 2], StringFreeQ[#, "00"] &]] (* Paolo Xausa, Apr 05 2024 *)
Extensions
Index in formula corrected, missing parts of the maple code recovered, and sequence extended by R. J. Mathar, Oct 23 2010
Definition expanded and DuchĂȘne, Fraenkel et al. reference added by N. J. A. Sloane, Aug 07 2018
Comments