cp's OEIS Frontend

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.

Showing 1-9 of 9 results.

A288575 Partial sums of A104324.

Original entry on oeis.org

0, 1, 3, 5, 8, 10, 13, 17, 19, 22, 26, 30, 35, 37, 40, 44, 48, 53, 57, 62, 68, 70, 73, 77, 81, 86, 90, 95, 101, 105, 110, 116, 122, 129, 131, 134, 138, 142, 147, 151, 156, 162, 166, 171, 177, 183, 190, 194, 199, 205, 211, 218, 224, 231, 239, 241, 244, 248, 252, 257, 261, 266, 272, 276, 281, 287, 293
Offset: 0

Views

Author

N. J. A. Sloane, Jun 30 2017

Keywords

Crossrefs

Cf. A104324.

A288576 The Fibonacci word in A104324 partitioned into blocks.

Original entry on oeis.org

0, 1, 22, 323, 42344, 52344545, 6234454564566, 723445456456674566767, 8234454564566745667678456676786788, 9234454564566745667678456676786788945667678678896788989
Offset: 0

Views

Author

N. J. A. Sloane, Jun 30 2017

Keywords

Comments

This way of representing the block structure of A104324 is used by Zhang et al. (2017), but of course only makes sense for blocks 0 through 9.

Examples

			The initial blocks are as follows:
 0,
 1,
 22,
 323,
 42344,
 52344545,
 6234454564566,
 723445456456674566767,
 8234454564566745667678456676786788,
 9234454564566745667678456676786788945667678678896788989,
 ...
but if the commas are inserted (as they should be) then we see the blocks more clearly:
 0,
 1,
 2,2,
 3,2,3,
 4,2,3,4,4,
 5,2,3,4,4,5,4,5,
 6,2,3,4,4,5,4,5,6,4,5,6,6,
 7,2,3,4,4,5,4,5,6,4,5,6,6,7,4,5,6,6,7,6,7,
 8,2,3,4,4,5,4,5,6,4,5,6,6,7,4,5,6,6,7,6,7,8,4,5,6,6,7,6,7,8,6,7,8,8,
 9,2,3,4,4,5,4,5,6,4,5,6,6,7,4,5,6,6,7,6,7,8,4,5,6,6,7,6,7,8,6,7,8,8,9,4,5,6,6,7,6,7,8,6,7,8,8,9,6,7,8,8,9,8,9,
 10,2,3,4,4,5,4,5,6,4,5,6,6,7,4,5,6,6,7,6,7,8,4,5,6,6,7,6,7,8,6,7,8,8,9,4,5,6,6,7,6,7,8,6,7,8,8,9,6,7,8,8,9,8,9,10,4,5,6,6,7,6,7,8,6,7,8,8,9,6,7,8,8,9,8,9,10,6,7,8,8,9,8,9,10,8,9,10,10,
...
		

Crossrefs

Block n has length Fibonacci(n), see A000045.

A007895 Number of terms in the Zeckendorf representation of n (write n as a sum of non-consecutive distinct Fibonacci numbers).

Original entry on oeis.org

0, 1, 1, 1, 2, 1, 2, 2, 1, 2, 2, 2, 3, 1, 2, 2, 2, 3, 2, 3, 3, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 3, 4, 4, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 2, 3, 3, 3, 4, 3, 4, 4, 2, 3, 3, 3, 4, 3, 4, 4, 3, 4, 4, 4, 5, 1, 2, 2, 2, 3, 2, 3, 3, 2, 3, 3, 3, 4, 2, 3, 3
Offset: 0

Views

Author

Felix Weinstein (wain(AT)ana.unibe.ch) and Clark Kimberling

Keywords

Comments

Also number of 0's (or B's) in the Wythoff representation of n -- see the Reble link. See also A135817 for references and links for the Wythoff representation for n >= 1. - Wolfdieter Lang, Jan 21 2008; N. J. A. Sloane, Jun 28 2008
Or, a(n) is the number of applications of Wythoff's B sequence A001950 needed in the unique Wythoff representation of n >= 1. E.g., 16 = A(B(A(A(B(1))))) = ABAAB = `10110`, hence a(16) = 2. - Wolfdieter Lang, Jan 21 2008
Let M(0) = 0, M(1) = 1 and for i > 0, M(i+1) = f(concatenation of M(j), j from 0 to i - 1) where f is the morphism f(k) = k + 1. Then the sequence is the concatenation of M(j) for j from 0 to infinity. - Claude Lenormand (claude.lenormand(AT)free.fr), Dec 16 2003
From Joerg Arndt, Nov 09 2012: (Start)
Let m be the number of parts in the listing of the compositions of n into odd parts as lists of parts in lexicographic order, a(k) = (n - length(composition(k)))/2 for all k < Fibonacci(n) and all n (see example).
Let m be the number of parts in the listing of the compositions of n into parts 1 and 2 as lists of parts in lexicographic order, a(k) = n - length(composition(k)) for all k < Fibonacci(n) and all n (see example).
A000120 gives the equivalent for (all) compositions. (End)
a(n) = A104324(n) - A213911(n); row lengths in A035516 and A035516. - Reinhard Zumkeller, Mar 10 2013
a(n) is also the minimum number of Fibonacci numbers which sum to n, regardless of adjacency or duplication. - Alan Worley, Apr 17 2015
This follows from the fact that the sequence is subadditive: a(n+m) <= a(n) + a(m) for nonnegative integers n,m. See Lemma 2.1 of the Stoll link. - Robert Israel, Apr 17 2015
From Michel Dekking, Mar 08 2020: (Start)
This sequence is a morphic sequence on an infinite alphabet, i.e., (a(n)) is a letter-to-letter projection of a fixed point of a morphism tau.
The alphabet is {0,1,...,j,...}X{0,1}, and tau is given by
tau((j,0)) = (j,0) (j+1,1),
tau((j,1)) = (j,0).
The letter-to-letter map is given by the projection on the first coordinate: (j,i)->j for i=0,1.
To prove this, note first that the second coordinate of the letters generates the infinite Fibonacci word = A003849 = 0100101001001....
This implies that for all n and j one has
|tau^n(j,0)| = F(n+2),
where |w| denotes the length of a word w, and (F(n)) = A000045 are the Fibonacci numbers.
Secondly, we need the following simple, but crucial observation. Let the Zeckendorf representation of n be Z(n) = A014417(n). For example,
Z(0) = 0, Z(1) = 1, Z(2) = 10, Z(3) = 100, Z(4) = 101, Z(5) = 1000.
From the unicity of the Zeckendorf representation it follows that for the positions i = 0,1,...,F(n)-1 one has
Z(F(n+1)+i) = 10...0 Z(i),
where zeros are added to Z(i) to give the total representation length n-1.
This gives for i = 0,1,...,F(n)-1 that
a(F(n+1)+i) = a(i) + 1.
From the first observation follows that the first F(n+1) letters of tau^n(j,0) are equal to tau^{n-1}(j,0), and the last F(n) letters of tau^n(j,0) are equal to tau^{n-1}(j+1,1) = tau^{n-2}(j+1,0).
Combining this with the second observation shows that the first coordinate of the fixed point of tau, starting from (0,0), gives (a(n)).
It is of course possible to obtain a morphism tau' on the natural numbers by changing the alphabet: (j,0)-> 2j (j,1)-> 2j+1, which yields the morphism
tau'(2j) = 2j, 2j+3, tau'(2j+1) = 2j.
The fixed point of tau' starting with 0 is
u = 03225254254472544747625...
The corresponding letter-to-letter map lambda is given by lambda(2j)=j, lambda(2j+1)= j. Then lambda(u) = (a(n)).
(End)

Examples

			a(46) = a(1 + 3 + 8 + 34) = 4.
From _Joerg Arndt_, Nov 09 2012: (Start)
Connection to the compositions of n into odd parts (see comment):
[ #]:  a(n)  composition into odd parts
[ 0]   [ 0]   1 1 1 1 1 1 1 1
[ 1]   [ 1]   1 1 1 1 1 3
[ 2]   [ 1]   1 1 1 1 3 1
[ 3]   [ 1]   1 1 1 3 1 1
[ 4]   [ 2]   1 1 1 5
[ 5]   [ 1]   1 1 3 1 1 1
[ 6]   [ 2]   1 1 3 3
[ 7]   [ 2]   1 1 5 1
[ 8]   [ 1]   1 3 1 1 1 1
[ 9]   [ 2]   1 3 1 3
[10]   [ 2]   1 3 3 1
[11]   [ 2]   1 5 1 1
[12]   [ 3]   1 7
[13]   [ 1]   3 1 1 1 1 1
[14]   [ 2]   3 1 1 3
[15]   [ 2]   3 1 3 1
[16]   [ 2]   3 3 1 1
[17]   [ 3]   3 5
[18]   [ 2]   5 1 1 1
[19]   [ 3]   5 3
[20]   [ 3]   7 1
Connection to the compositions of n into parts 1 or 2 (see comment):
[ #]:  a(n)  composition into parts 1 and 2
[ 0]   [0]   1 1 1 1 1 1 1
[ 1]   [1]   1 1 1 1 1 2
[ 2]   [1]   1 1 1 1 2 1
[ 3]   [1]   1 1 1 2 1 1
[ 4]   [2]   1 1 1 2 2
[ 5]   [1]   1 1 2 1 1 1
[ 6]   [2]   1 1 2 1 2
[ 7]   [2]   1 1 2 2 1
[ 8]   [1]   1 2 1 1 1 1
[ 9]   [2]   1 2 1 1 2
[10]   [2]   1 2 1 2 1
[11]   [2]   1 2 2 1 1
[12]   [3]   1 2 2 2
[13]   [1]   2 1 1 1 1 1
[14]   [2]   2 1 1 1 2
[15]   [2]   2 1 1 2 1
[16]   [2]   2 1 2 1 1
[17]   [3]   2 1 2 2
[18]   [2]   2 2 1 1 1
[19]   [3]   2 2 1 2
[20]   [3]   2 2 2 1
(End)
From _Michel Dekking_, Mar 08 2020: (Start)
The third iterate of the morphism tau generating this sequence:
      tau^3((0,0)) = (0,0)(1,1)(1,0)(1,0)(2,1)
= (a(0),0)(a(1),1)(a(2),0)(a(3),0)(a(4),1). (End)
		

References

  • Cornelius Gerrit Lekkerkerker, Voorstelling van natuurlijke getallen door een som van getallen van Fibonacci, Simon Stevin 29 (1952), 190-195.
  • F. Weinstein, The Fibonacci Partitions, preprint, 1995.
  • Édouard Zeckendorf, Représentation des nombres naturels par une somme des nombres de Fibonacci ou de nombres de Lucas, Bull. Soc. Roy. Sci. Liège 41, 179-182, 1972.

Crossrefs

Cf. A135817 (lengths of Wythoff representation), A135818 (number of 1's (or A's) in the Wythoff representation).
Record positions are in A027941.

Programs

  • Haskell
    a007895 = length . a035516_row  -- Reinhard Zumkeller, Mar 10 2013
    
  • Maple
    # With the following Maple program (not the best one), B(n) (n >= 1) yields the number of terms in the Zeckendorf representation of n.
    with(combinat): B := proc (n) local A, ct, m, j: A := proc (n) local i: for i while fibonacci(i) <= n do n-fibonacci(i) end do end proc: ct := 0; m := n: for j while 0 < A(m) do ct := ct+1: m := A(m) end do: ct+1 end proc: 0, seq(B(n), n = 1 .. 104);
    # Emeric Deutsch, Jul 05 2010
    N:= 1000: # to get a(n) for n <= N
    m:= ceil(log[(1+sqrt(5))/2](sqrt(5)*N)):
    Z:= Vector(m):
    a[0]:= 0:
    for n from 1 to N do
    if Z[1] = 0 then Z[1]:= 1; q:= 1;
    else Z[2]:= 1; Z[1]:= 0; q:= 2;
    fi;
    while Z[q+1] = 1 do
      Z[q]:= 0;
      Z[q+1]:= 0;
      Z[q+2]:= 1;
      q:= q+2;
    od:
    a[n]:= add(Z[i],i=1..m);
    od:
    seq(a[n],n=0..N); # Robert Israel, Apr 17 2015
    # alternative
    read("transforms") : # https://oeis.org/transforms.txt
    A007895 := proc(n)
        wt(A003714(n)) ;
    end proc:
    seq(A007895(n),n=0..10) ; # R. J. Mathar, Sep 22 2020
  • Mathematica
    zf[n_] := (k = 1; ff = {}; While[(fi = Fibonacci[k]) <= n, AppendTo[ff, fi]; k++]; Drop[ff, 1]); zeckRep[n_] := If[n == 0, 0, r = n; s = {}; fr = zf[n]; While[r > 0, lf = Last[fr]; If[lf <= r, r = r - lf; PrependTo[s, lf]]; fr = Drop[fr, -1]]; s]; zeckRepLen[n_] := Length[zeckRep[n]]; Table[zeckRepLen[n], {n, 0, 104}] (* Jean-François Alcover, Sep 27 2011 *)
    DigitCount[Select[Range[0, 1000], BitAnd[#, 2#] == 0 &], 2, 1] (* Jean-François Alcover, Jan 25 2018 *)
    Table[Length[DeleteCases[NestWhileList[# - Fibonacci[Floor[Log[Sqrt[5] * # + 3/2]/Log[GoldenRatio]]] &, n, # > 1 &], 0]], {n, 0, 143}] (* Alonso del Arte, May 14 2019 *)
    Flatten[Nest[{Flatten[#], #[[1]] + 1} &, {0, 1}, 9]] (* Paolo Xausa, Jun 17 2024 *)
  • PARI
    a(n,mx=0)=if(n<4,n>0,if(!mx,while(fibonacci(mx)n,mx--); 1+a(n-fibonacci(mx),mx-2)) \\ Charles R Greathouse IV, Feb 14 2013
    
  • PARI
    a(n)=if(n<4, n>0, my(k=2,s,t); while(fibonacci(k++)<=n,); while(k && n, t=fibonacci(k); if(t<=n, n-=t; s++); k--); s) \\ Charles R Greathouse IV, Sep 02 2015
    
  • Python
    from sympy import fibonacci
    def a(n):
        k=0
        x=0
        while n>0:
            k=0
            while fibonacci(k)<=n: k+=1
            x+=10**(k - 3)
            n-=fibonacci(k - 1)
        return str(x).count("1")
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 09 2017

Formula

a(n) = A000120(A003714(n)). - Reinhard Zumkeller, May 05 2005
a(n) = A107015(n) + A107016(n). - Reinhard Zumkeller, May 09 2005
a(n) = A143299(n+1) - 1. - Filip Zaludek, Oct 31 2016
a(n) = A007953(A014417(n)). - Amiram Eldar, Oct 10 2023

Extensions

Edited by N. J. A. Sloane Jun 27 2008 at the suggestion of R. J. Mathar and Don Reble

A014417 Representation of n in base of Fibonacci numbers (the Zeckendorf representation of n). Also, binary words starting with 1 not containing 11, with the word 0 added.

Original entry on oeis.org

0, 1, 10, 100, 101, 1000, 1001, 1010, 10000, 10001, 10010, 10100, 10101, 100000, 100001, 100010, 100100, 100101, 101000, 101001, 101010, 1000000, 1000001, 1000010, 1000100, 1000101, 1001000, 1001001, 1001010, 1010000, 1010001, 1010010, 1010100, 1010101
Offset: 0

Views

Author

Keywords

Comments

Old name was: Representation of n in base of Fibonacci numbers (the Zeckendorf representation of n). Also, binary vectors not containing 11.
For n > 0, write n = Sum_{i >= 2} eps(i) Fib_i where eps(i) = 0 or 1 and no 2 consecutive eps(i) can be 1 (see A035517); then a(n) is obtained by writing the eps(i) in reverse order.
"One of the most important properties of the Fibonacci numbers is the special way in which they can be used to represent integers. Let's write j >> k <==> j >= k+2. Then every positive integer has a unique representation of the form n = F_k1 + F_k2 + ... + F_kr, where k1 >> k2 >> ... >> kr >> 0. (This is 'Zeckendorf's theorem.') ... We can always find such a representation by using a "greedy" approach, choosing F_k1 to be the largest Fibonacci number =< n, then choosing F_k2 to be the largest that is =< n - F_k1 and so on. Fibonacci representation needs a few more bits because adjacent 1's are not permitted; but the two representations are analogous." [Concrete Math.]
Since the binary representation of n in base of Fibonacci numbers allows only the successive bit pairs 00, 01, 10 and leaves 11 unused, we can use a ternary representation using all trits 0, 1, 2 where 00 --> 0, 01 --> 1 and 10 --> 2 (e.g. binary 1001010 as ternary 1022). - Daniel Forgues, Nov 30 2009
The same sequence also arises when considering the NegaFibonacci representations of the integers, as follows. Take the NegaFibonacci representations of n = 0, 1, 2, ... (A215022) and of n = -1, -2, -3, ... (A215023), sort the union of these two lists into increasing binary order, and we get A014417. Likewise the corresponding list of decimal representations, A003714, is the union of A215024 and A215025 sorted into increasing order. - N. J. A. Sloane, Aug 10 2012
Also, numbers, written in binary, such that no adjacent bits are equal to 1: A one-dimensional analog of the matrices considered in A228277/A228285, A228390, A228476, A228506 etc. - M. F. Hasler, Apr 27 2014
The sequence of final bits, starting with a(1), is the complement of the Fibonacci word A005614. - N. J. A. Sloane, Oct 03 2018
This representation is named after the Belgian Army doctor and mathematician Edouard Zeckendorf (1901-1983). - Amiram Eldar, Jun 11 2021

Examples

			The Zeckendorf expansions of 1, 2, ... are 1 = 1 = Fib_2 -> 1, 2 = 2 = Fib_3 -> 10, 3 = Fib_4 -> 100, 4 = 3+1 = Fib_4 + Fib_2 -> 101, 5 = 5 = Fib_5 -> 1000, 6 = 1+5 = Fib_2 + Fib_5 -> 1001, etc.
		

References

  • Ronald L. Graham, Donald E. Knuth and Oren Patashnik, Concrete Mathematics. Addison-Wesley, Reading, MA, 1990.
  • Donald E. Knuth, The Art of Computer Programming, Vol. 4A, Section 7.1.3, p. 169.
  • Edouard Zeckendorf, Représentation des nombres naturels par une somme des nombres de Fibonacci ou de nombres de Lucas, Bull. Soc. Roy. Sci. Liège 41, 179-182, 1972.

Crossrefs

a(n) = A003714(n) converted to binary.
See A104326 for dual Zeckendorf representation of n.

Programs

  • Haskell
    a014417 0 = 0
    a014417 n = foldl (\v z -> v * 10 + z) 0 $ a189920_row n
    -- Reinhard Zumkeller, Mar 10 2013
    
  • Maple
    A014417 := proc(n)
        local nshi,Z,i ;
        if n <= 1 then
            return n;
        end if;
        nshi := n ;
        Z := [] ;
        for i from A130234(n) to 2 by -1 do
            if nshi >= A000045(i) and nshi > 0 then
                Z := [1,op(Z)] ;
                nshi := nshi-A000045(i) ;
            else
                Z := [0,op(Z)] ;
            end if;
        end do:
        add( op(i,Z)*10^(i-1),i=1..nops(Z)) ;
    end proc: # R. J. Mathar, Jan 31 2015
  • Mathematica
    fb[n_Integer] := Block[{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-- ]; FromDigits[fr]]; Table[ fb[n], {n, 0, 30}] (* Robert G. Wilson v, May 15 2004 *)
    r = Map[Fibonacci, Range[2, 12]]; Table[Total[FromDigits@ PadRight[{1}, Flatten@ #] &@ Reverse@ Position[r, #] & /@ Abs@ Differences@ NestWhileList[Function[k, k - SelectFirst[Reverse@ r, # < k &]], n + 1, # > 1 &]], {n, 0, 33}] (* Michael De Vlieger, Mar 27 2016, Version 10 *)
    FromDigits/@Select[Tuples[{0,1},7],SequenceCount[#,{1,1}]==0&] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Aug 14 2019 *)
  • PARI
    Zeckendorf(n)=my(k=0,v,m); while(fibonacci(k)<=n,k=k+1); m=k-1; v=vector(m-1); v[1]=1; n=n-fibonacci(k-1); while(n>0,k=0; while(fibonacci(k)<=n,k=k+1); v[m-k+2]=1; n=n-fibonacci(k-1)); v \\ Ralf Stephan
    
  • PARI
    Zeckendorf(n)= { local(k); a=0; while(n>0, k=0; while(fibonacci(k)<=n, k=k+1); a=a+10^(k-3); n=n-fibonacci(k-1); ); a }
    { for (n=0, 10000, Zeckendorf(n); print(n," ",a); write("b014417.txt", n, " ", a) ) } \\ Harry J. Smith, Jan 17 2009
    
  • Python
    from sympy import fibonacci
    def a(n):
        k=0
        x=0
        while n>0:
            k=0
            while fibonacci(k)<=n: k+=1
            x+=10**(k - 3)
            n-=fibonacci(k - 1)
        return x
    print([a(n) for n in range(101)]) # Indranil Ghosh, Jun 07 2017, after PARI code by Harry J. Smith

Extensions

Comment layout fixed by Daniel Forgues, Dec 07 2009
Typo corrected by Daniel Forgues, Mar 25 2010
Definition expanded and Duchene et al. reference added by N. J. A. Sloane, Aug 07 2018
Name corrected by Michel Dekking, Nov 30 2020

A104326 Dual Zeckendorf representation of n or the maximal (binary) Fibonacci representation. Also list of binary vectors not containing 00.

Original entry on oeis.org

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

Views

Author

Ron Knott, Mar 01 2005

Keywords

Comments

Whereas the Zeckendorf (binary) rep (A014417) has no consecutive 1's (no two consecutive Fibonacci numbers in a set whose sum is n), the Dual Zeckendorf Representation has no consecutive 0's. Also called the Maximal (Binary) Fibonacci Representation, the Zeckendorf rep. being the Minimal in terms of number of 1's in the binary representation.
Also known as the lazy Fibonacci representation of n. - Glen Whitney, Oct 21 2017

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).
		

Crossrefs

Cf. A007088 (binary vectors), A014417, A095791, A104324.
A003754 gives the numbers corresponding to the binary digit strings seen here.

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 *)

Formula

a(n) = A007088(A003754(n+1)).

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

A213911 Number of runs of consecutive zeros in the Zeckendorf (binary) representation of n.

Original entry on oeis.org

0, 0, 1, 1, 1, 1, 1, 2, 1, 1, 2, 2, 2, 1, 1, 2, 2, 2, 2, 2, 3, 1, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 1, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 4, 1, 1, 2, 2, 2, 2, 2, 3, 2, 2, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 4, 2, 2, 3, 3, 3, 3, 3, 4, 3, 3, 4
Offset: 0

Views

Author

Reinhard Zumkeller, Mar 10 2013

Keywords

Crossrefs

Programs

  • Haskell
    import Data.List (group)
    a213911 = length . filter ((== 0) . head) . group . a213676_row

Formula

a(n) = A104324(n) - A007895(n).
a(n) = A007895(n) - A003849(n). - Alexander Staunton, Jan 15 2025

Extensions

a(0)=0 added by N. J. A. Sloane, Jun 30 2017

A117479 Number of zeros in the maximal Fibonacci bit-representation of n (A104326).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 2, 1, 1, 1, 0, 2, 2, 1, 2, 1, 1, 1, 0, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 3, 3, 2, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 4, 3, 3, 3, 2, 3, 3, 2, 3, 2, 2, 2, 1, 3, 3, 2, 3, 2, 2, 2, 1, 3, 2, 2, 2, 1, 2, 2, 1, 2, 1, 1, 1, 0, 4
Offset: 0

Views

Author

Casey Mongoven, Mar 20 2006

Keywords

Examples

			a(7) = 2 because A104326(7) = 1010 contains 2 zeros.
		

Crossrefs

A104325 Number of runs of equal bits in the dual Zeckendorf representation of n (A104326).

Original entry on oeis.org

1, 1, 2, 1, 3, 2, 1, 4, 3, 3, 2, 1, 5, 4, 3, 4, 3, 3, 2, 1, 6, 5, 5, 4, 3, 5, 4, 3, 4, 3, 3, 2, 1, 7, 6, 5, 6, 5, 5, 4, 3, 6, 5, 5, 4, 3, 5, 4, 3, 4, 3, 3, 2, 1, 8, 7, 7, 6, 5, 7, 6, 5, 6, 5, 5, 4, 3, 7, 6, 5, 6, 5, 5, 4, 3, 6, 5, 5, 4, 3, 5, 4, 3, 4, 3, 3, 2, 1, 9, 8, 7, 8, 7, 7, 6, 5, 8, 7, 7, 6, 5
Offset: 0

Views

Author

Ron Knott, Mar 01 2005

Keywords

Comments

Sequence has some interesting fractal properties (plot it!)

Examples

			The dual Zeckendorf representation of 13 is 10110(fib) corresponding to {8, 3, 2}.
The largest set of Fibonacci numbers whose sum is n (cf. the Zeckendorf representation is the smallest set). This is composed of runs of one 1, one 0, two 1's, one 0 i.e. 4 runs in all, so a(13) = 4.
		

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: countruns:=proc(s)local i,c,elt;elt:=s[1];c:=1; for i from 2 to nops(s) do if s[i]<>s[i-1] then c:=c+1 fi od; c end proc: seq(countruns(dualzeckrep(n)),n=1..100);
  • Mathematica
    Length @ Split[IntegerDigits[#, 2]] & /@  Select[Range[0, 1000], SequenceCount[ IntegerDigits[#, 2], {0, 0}] == 0 &] (* Amiram Eldar, Jan 18 2020 *)

Extensions

Offset changed to 0 and a(0) prepended by Amiram Eldar, Jan 18 2020

A288577 Image of 0 under repeated application of the morphism phi = {x -> x,x+1,x+2 if x mod 3 = 0; x -> x+1 if x mod 3 = 1 or 2, for x = 0,1,2,3,...}.

Original entry on oeis.org

0, 1, 2, 2, 3, 3, 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 6, 3, 4, 5, 5, 6, 3, 4, 5, 5, 6, 6, 6, 7, 8, 3, 4, 5, 5, 6, 6, 6, 7, 8, 3, 4, 5, 5, 6, 6, 6, 7, 8, 6, 7, 8, 6, 7, 8, 8, 9, 3, 4, 5, 5, 6, 6, 6, 7, 8, 6, 7, 8, 6, 7, 8, 8, 9, 3, 4, 5, 5, 6, 6, 6, 7, 8, 6, 7, 8, 6, 7, 8, 8, 9, 6, 7, 8, 8, 9, 6, 7, 8, 8, 9, 9, 9, 10, 11
Offset: 0

Views

Author

N. J. A. Sloane, Jul 01 2017

Keywords

Comments

An analog of A104324 when "Fibonacci" is replaced with "tribonacci".
From Kerry Mitchell, Jul 01 2017: (Start)
This is the limit of a series of iterations. The length of each iteration is given by A000213, beginning with the second term of that sequence (1, 3, 5, 9, 17, etc.):
0
0, 1, 2
0, 1, 2, 2, 3
0, 1, 2, 2, 3, 3, 3, 4, 5
0, 1, 2, 2, 3, 3, 3, 4, 5, 3, 4, 5, 3, 4, 5, 5, 6
etc.
When written in blocks this way, each subsequent block is the concatenation of the previous block, the third-previous block with each term incremented by 3, and the second-previous block, with each term incremented by 3. (End)

References

  • Kerry Mitchell, Posting to Sequence Fans Mailing List, Jun 30 2017

Crossrefs

Cf. A104324.

Programs

  • Mathematica
    SubstitutionSystem[{x_ -> If[Mod[x, 3] == 0, {x, x+1, x+2}, {x+1}]}, {0}, 7] // Last (* Jean-François Alcover, Jan 21 2018 *)

Extensions

More terms from Kerry Mitchell, Jul 01 2017
Showing 1-9 of 9 results.