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-10 of 10 results.

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

A228285 T(n,k) = Number of n X k binary arrays with top left value 1 and no two ones adjacent horizontally, vertically or nw-se diagonally.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 3, 3, 3, 3, 5, 6, 13, 6, 5, 8, 13, 35, 35, 13, 8, 13, 28, 112, 133, 112, 28, 13, 21, 60, 337, 587, 587, 337, 60, 21, 34, 129, 1034, 2448, 3631, 2448, 1034, 129, 34, 55, 277, 3154, 10414, 21166, 21166, 10414, 3154, 277, 55, 89, 595, 9637, 44024, 126119
Offset: 1

Views

Author

R. H. Hardin, Aug 19 2013

Keywords

Examples

			Table starts
   1   1    2      3       5        8         13          21            34
   1   1    3      6      13       28         60         129           277
   2   3   13     35     112      337       1034        3154          9637
   3   6   35    133     587     2448      10414       44024        186414
   5  13  112    587    3631    21166     126119      745178       4416695
   8  28  337   2448   21166   172082    1428523    11771298      97268701
  13  60 1034  10414  126119  1428523   16566199   190540884    2197847780
  21 129 3154  44024  745178 11771298  190540884  3057290265   49208639399
  34 277 9637 186414 4416695 97268701 2197847780 49208639399 1105411581741
Some solutions for n=4, k=4:
  1 0 0 1   1 0 0 1   1 0 0 0   1 0 1 0   1 0 0 0
  0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0   0 0 0 0
  0 0 0 1   0 0 0 1   0 0 0 0   0 0 0 0   0 0 0 1
  0 0 1 0   0 1 0 0   0 1 0 1   1 0 1 0   1 0 0 0
		

Crossrefs

Column 1 is A000045.
Column 2 is A002478(n-1).
For columns 3 through 9 see A228278, A228279, A228280, A228281, A228282, A228283, A228284.
For the main diagonal (n X n matrices) see A228277.
If the requirement that the top corner is 1 is omitted we get A226444.
If the "nw-se" condition in the definition is changed to "ne-sw", we get A228476-A228482.
See also A228390 and A228506 for other variants.

Formula

Empirical for column k:
k=1: a(n) = a(n-1) + a(n-2).
k=2: a(n) = a(n-1) + 2*a(n-2) + a(n-3).
k=3: a(n) = a(n-1) + 5*a(n-2) + 4*a(n-3) - a(n-5) with g.f. x(2+x-x^3)/((1+x)(1-2x-3x^2-x^3+x^4)).
k=4: a(n) = a(n-1) +10*a(n-2) +15*a(n-3) +4*a(n-4) -6*a(n-5) -a(n-6) +3*a(n-7) -a(n-8) with g.f. x *(x-1) *(2*x^3 -5*x^2 -6*x -3) / ( 1 -x -10*x^2 -15*x^3 -4*x^4 +6*x^5 +x^6 -3*x^7 +x^8 ).
k=5: [order 13] - see A228280.
k=6: [order 21]
k=7: [order 34]
k=8: [order 55]
k=9: [order 89]
From Doron Zeilberger, Aug 19 2013 and Aug 22 2013: (Start)
Using the C-finite Ansatz one can show that the k-th column satisfies a recurrence of order F_{k+2} for all k. For k <= 11, this is the minimal order. The empirical g.f.'s given above are correct. For further g.f.'s and Maple code, see the links.
In more detail: Every k X n Hardin matrix can be viewed as a walk, of length n, on a graph with F_{k+2} vertices (labeled by the set of {0,1} vectors of length k that avoid two consecutive 1's, which is well known and fairly easy to see has cardinality F_{k+2}).
Then the computer constructs the adjacency matrix.
There is an edge between vertex v1 and vertex v2 only if it is NOT the case that there exists an i (1 <= i <= k) such that v1[i]=1 and v2[i]=1 AND it is not the case that there exists an i (1 <= i <= k-1) such that v1[i]=1 and v2[i+1]=1.
Let us call this matrix A(k).
Then the number of k X n Hardin matrices (without the restriction that the top-left entry is 1, A226444) is the sum of the entries (i,j) of A(k)^n, or equivalently (1,...., 1) A(k)^n (1, ...., 1)^T.
So
f_k(x) = Sum_{n>=0} a(n)*x^n
= (1,...., 1) Sum_{n>=0} A(k)^n*x^n (1, ...., 1)^T
= (1,...., 1) (I-A*x)^(-1)(1, ...., 1)^T
and Maple knows how to invert the symbolic matrix (I-A*x), and this explains why the characteristic polynomial is the symbol for the recurrence.
If we impose that restriction then the answer (A228285) is
[0-1-Vector with 1's for those whose first entry is 1] A(k)^n (1, ...., 1)^T.
(End)

Extensions

Edited by N. J. A. Sloane, Aug 22 2013
Minor corrections and further edits by M. F. Hasler, Apr 28 2014

A228277 Number of n X n binary arrays with top left value 1 and no two ones adjacent horizontally, vertically or nw-se diagonally.

Original entry on oeis.org

1, 1, 13, 133, 3631, 172082, 16566199, 3057290265, 1105411581741, 776531523355217, 1063228770141145384, 2834013489992345694498, 14712337761578682394367473, 148727865257442275211424889367
Offset: 1

Views

Author

R. H. Hardin, Aug 19 2013

Keywords

Comments

Main diagonal of A228285.

Examples

			The thirteen solutions for n=3 correspond to the thirteen possible values of 5-bit numbers with no two adjacent bits equal to 1, namely, the matrices
( 1 0 a )
( 0 0 b )
( e d c ) ; with abcde = A014417(0,...,12) = 0, 1, 10, 100, 101, 1000, 1001, 1010, 10000, 10001, 10010, 10100, 10101 (leading zeros omitted). - _M. F. Hasler_, Apr 27 2014
Some solutions for n=4:
.1..0..0..1.  .1..0..0..0.  .1..0..0..0.  .1..0..0..0.  .1..0..0..0
.0..0..0..0.  .0..0..0..1.  .0..0..0..0.  .0..0..1..0.  .0..0..0..0
.0..0..0..0.  .0..0..0..0.  .0..0..0..0.  .0..0..0..0.  .0..0..0..1
.1..0..0..1.  .0..1..0..1.  .0..1..0..1.  .0..1..0..0.  .0..0..1..0
The last example shows that sw-ne (= anti)diagonally adjacent "1"s are allowed. See A228476, A228506 and A228390 for other variants.
		

Crossrefs

See also the variants A228390, A228476, A228506, etc.

Formula

No known recurrence.

A228280 Number of nX5 binary arrays with top left value 1 and no two ones adjacent horizontally, vertically or nw-se diagonally.

Original entry on oeis.org

5, 13, 112, 587, 3631, 21166, 126119, 745178, 4416695, 26150120, 154877307, 917205757, 5431915952, 32169045631, 190512481196, 1128258633821, 6681806858103, 39571194265886, 234349700556332, 1387872742075595
Offset: 1

Views

Author

R. H. Hardin Aug 19 2013

Keywords

Comments

Column 5 of A228285.

Examples

			Some solutions for n=4
..1..0..1..0..0....1..0..0..0..0....1..0..1..0..0....1..0..0..0..0
..0..0..0..0..0....0..0..0..1..0....0..0..0..0..0....0..0..0..0..1
..0..0..0..1..0....0..0..0..0..0....0..1..0..1..0....0..1..0..1..0
..0..1..0..0..0....0..0..1..0..1....1..0..0..0..0....1..0..0..0..0
		

Crossrefs

See A228277-A228285, especially the latter.
See also the k=5 variants of A228390, A228476, A228506 etc.

Formula

a(n) = a(n-1) +21*a(n-2) +48*a(n-3) +14*a(n-4) -69*a(n-5) -38*a(n-6) +68*a(n-7) +13*a(n-8) -57*a(n-9) +37*a(n-10) -8*a(n-11) -2*a(n-12) +a(n-13)
G.f.: x*(5 + 8*x - 6*x^2 - 38*x^3 - 2*x^4 - 5*x^5 + 45*x^6 - 51*x^7 + 26*x^8 - 4*x^9 - 2*x^10 + x^11)/((1 + 2*x - 2*x^3 + x^4)*(1 - 3*x - 15*x^2 - 16*x^3 + 11*x^4 + 20*x^5 - 19*x^6 + 8*x^7 - x^9)). - M. F. Hasler, Apr 27 2014

Extensions

Edited by N. J. A. Sloane, Aug 22 2013

A228500 Number of n X n binary arrays with top left value 1 and no two ones adjacent horizontally, vertically, diagonally or antidiagonally.

Original entry on oeis.org

1, 1, 12, 87, 2002, 59839, 3862849, 405580157, 81304395949, 28446567810005, 18268841726936268, 20937720031330292269, 43502129718103134992611, 162426195975365708781849519, 1095156092719874995442597502324
Offset: 1

Views

Author

R. H. Hardin Aug 23 2013

Keywords

Comments

Diagonal of A228506

Examples

			Some solutions for n=4
..1..0..0..1....1..0..0..1....1..0..0..0....1..0..1..0....1..0..0..0
..0..0..0..0....0..0..0..0....0..0..0..0....0..0..0..0....0..0..0..1
..1..0..0..1....0..1..0..1....0..0..0..0....0..0..1..0....0..0..0..0
..0..0..0..0....0..0..0..0....0..1..0..0....1..0..0..0....0..0..0..1
		

A228501 Number of n X 3 binary arrays with top left value 1 and no two ones adjacent horizontally, vertically, diagonally or antidiagonally.

Original entry on oeis.org

2, 3, 12, 29, 88, 239, 684, 1909, 5392, 15143, 42644, 119933, 337512, 949535, 2671740, 7517061, 21150272, 59508247, 167433188, 471090573, 1325464216, 3729333775, 10492879052, 29522830997, 83065631600, 233713998087, 657579228980
Offset: 1

Views

Author

R. H. Hardin, Aug 23 2013

Keywords

Examples

			Some solutions for n=4:
..1..0..1....1..0..0....1..0..1....1..0..0....1..0..0....1..0..1....1..0..0
..0..0..0....0..0..1....0..0..0....0..0..0....0..0..0....0..0..0....0..0..1
..0..0..1....0..0..0....0..0..1....1..0..1....0..0..0....0..1..0....0..0..0
..0..0..0....1..0..0....1..0..0....0..0..0....0..0..1....0..0..0....0..0..0
		

Crossrefs

Column 3 of A228506.

Formula

Empirical: a(n) = 2*a(n-1) + 3*a(n-2) - 2*a(n-3).
Empirical g.f.: x*(2 - x) / (1 - 2*x - 3*x^2 + 2*x^3). - Colin Barker, Sep 11 2018

A228502 Number of n X 4 binary arrays with top left value 1 and no two ones adjacent horizontally, vertically, diagonally or antidiagonally.

Original entry on oeis.org

3, 5, 29, 87, 358, 1252, 4749, 17285, 64235, 236211, 873250, 3219652, 11886927, 43856285, 161862005, 597285195, 2204231074, 8134165648, 30017792409, 110774426621, 408792375587, 1508567655759, 5567079710158, 20544224979592
Offset: 1

Views

Author

R. H. Hardin, Aug 23 2013

Keywords

Examples

			Some solutions for n=4:
..1..0..1..0....1..0..1..0....1..0..0..0....1..0..0..1....1..0..1..0
..0..0..0..0....0..0..0..0....0..0..1..0....0..0..0..0....0..0..0..0
..0..0..1..0....0..0..0..0....0..0..0..0....0..0..1..0....0..0..0..0
..1..0..0..0....0..0..0..1....1..0..0..1....1..0..0..0....1..0..1..0
		

Crossrefs

Column 4 of A228506.

Formula

Empirical: a(n) = 2*a(n-1) + 7*a(n-2) - 2*a(n-3) - 3*a(n-4).
Empirical g.f.: x*(1 - x)*(3 + 2*x) / (1 - 2*x - 7*x^2 + 2*x^3 + 3*x^4). - Colin Barker, Sep 12 2018

A228503 Number of nX5 binary arrays with top left value 1 and no two ones adjacent horizontally, vertically, diagonally or antidiagonally.

Original entry on oeis.org

5, 11, 88, 358, 2002, 9528, 49101, 243118, 1228036, 6141239, 30865981, 154742849, 776765183, 3896668986, 19553995645, 98108834263, 492283814664, 2470048647138, 12393793010466, 62186850336292, 312029099308093, 1565635002686314
Offset: 1

Views

Author

R. H. Hardin Aug 23 2013

Keywords

Comments

Column 5 of A228506

Examples

			Some solutions for n=4
..1..0..0..0..0....1..0..0..0..0....1..0..0..0..0....1..0..0..0..1
..0..0..0..1..0....0..0..1..0..1....0..0..0..0..0....0..0..0..0..0
..0..0..0..0..0....1..0..0..0..0....0..1..0..0..1....1..0..0..0..0
..0..0..0..0..1....0..0..0..1..0....0..0..0..0..0....0..0..0..0..0
		

Formula

Empirical: a(n) = 2*a(n-1) +16*a(n-2) +a(n-3) -27*a(n-4) +a(n-5) +4*a(n-6).
Empirical: g.f. -x*(5+x-14*x^2+x^3+2*x^4) / ( -1+2*x+16*x^2+x^3-27*x^4+x^5+4*x^6 ). - R. J. Mathar, Aug 25 2013

A228504 Number of n X 6 binary arrays with top left value 1 and no two ones adjacent horizontally, vertically, diagonally or antidiagonally.

Original entry on oeis.org

8, 21, 239, 1252, 9528, 59839, 413786, 2724191, 18387032, 122539084, 821945828, 5495164996, 36800032261, 246231184011, 1648269251345, 11031030456148, 73833534042745, 494158034052549, 3307432804186754, 22136531409536410
Offset: 1

Views

Author

R. H. Hardin, Aug 23 2013

Keywords

Examples

			Some solutions for n=4:
..1..0..0..1..0..0....1..0..0..0..0..0....1..0..0..1..0..1....1..0..0..1..0..0
..0..0..0..0..0..1....0..0..0..0..0..1....0..0..0..0..0..0....0..0..0..0..0..1
..0..1..0..0..0..0....0..0..0..0..0..0....1..0..0..0..0..0....0..0..0..1..0..0
..0..0..0..0..0..0....1..0..1..0..0..1....0..0..0..0..1..0....0..1..0..0..0..0
		

Crossrefs

Column 6 of A228506.

Formula

Empirical: a(n) = 3*a(n-1) + 30*a(n-2) - 17*a(n-3) - 138*a(n-4) + 85*a(n-5) + 116*a(n-6) - 42*a(n-7) - 32*a(n-8).
Empirical g.f.: x*(8 - 3*x - 64*x^2 + 41*x^3 + 63*x^4 - 24*x^5 - 18*x^6) / (1 - 3*x - 30*x^2 + 17*x^3 + 138*x^4 - 85*x^5 - 116*x^6 + 42*x^7 + 32*x^8). - Colin Barker, Sep 12 2018

A228505 Number of nX7 binary arrays with top left value 1 and no two ones adjacent horizontally, vertically, diagonally or antidiagonally.

Original entry on oeis.org

13, 43, 684, 4749, 49101, 413786, 3862849, 34229311, 311423874, 2795565191, 25267110999, 227577191098, 2053397764249, 18510745379063, 166945846438154, 1505305762277273, 13574575402532525, 122405516285033798
Offset: 1

Views

Author

R. H. Hardin Aug 23 2013

Keywords

Comments

Column 7 of A228506

Examples

			Some solutions for n=4
..1..0..0..1..0..0..0....1..0..0..0..0..0..1....1..0..1..0..1..0..0
..0..0..0..0..0..0..0....0..0..0..0..0..0..0....0..0..0..0..0..0..1
..0..1..0..0..0..0..0....1..0..0..0..0..0..1....1..0..1..0..0..0..0
..0..0..0..0..0..1..0....0..0..1..0..1..0..0....0..0..0..0..0..1..0
		

Formula

Empirical: a(n) = 6*a(n-1) +50*a(n-2) -171*a(n-3) -514*a(n-4) +1800*a(n-5) +845*a(n-6) -5430*a(n-7) +704*a(n-8) +6175*a(n-9) -1762*a(n-10) -2810*a(n-11) +870*a(n-12) +392*a(n-13) -120*a(n-14)
Showing 1-10 of 10 results.