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.

A327992 The binary Fibonacci compositions. Irregular triangle with n >= 0 where the length of row n is Fibonacci(n) for n > 0.

This page as a plain text file.
%I A327992 #33 Mar 17 2020 15:19:08
%S A327992 1,11,111,101,1111,1101,1011,11111,1001,11101,11011,10111,111111,
%T A327992 11001,10101,10011,111101,111011,110111,101111,1111111,10001,111001,
%U A327992 110101,101101,110011,101011,100111,1111101,1111011,1110111,1101111,1011111,11111111
%N A327992 The binary Fibonacci compositions. Irregular triangle with n >= 0 where the length of row n is Fibonacci(n) for n > 0.
%C A327992 Taking up an idea of Cayley the binary Fibonacci compositions are defined as the conjugates of the compositions of n + 1 which do not have a part '1'. a(0) = 1 by convention and for n > 0 the representation of the composition c is given by Sum_{c} (2 - c[j])*2^j, where the c[j] are the parts of the composition c. With this interpretation the sequence is a permutation of the positive odd numbers (A005408).
%D A327992 A. Cayley, Theorems in Trigonometry and on Partitions, Messenger of Mathematics, 5 (1876), pp. 164, 188. Also in Mathematical Papers Vol. 10, n. 634, p. 16.
%H A327992 Peter Luschny, <a href="/A327992/b327992.txt">Table of n, a(n) for row 0..19</a>
%F A327992 The number of zeros in all binary Fibonacci compositions of n equal the number of elements in all subsets of {1, 2, ..., n} with no consecutive integers. (For example, the number of zeros in row 7 (see the triangle below) is 20 = A001629(6).)
%e A327992 The triangle starts:
%e A327992 [0] [    1]
%e A327992 [1] [   11]
%e A327992 [2] [  111]
%e A327992 [3] [  101,   1111]
%e A327992 [4] [ 1101,   1011,  11111]
%e A327992 [5] [ 1001,  11101,  11011,  10111, 111111]
%e A327992 [6] [11001,  10101,  10011, 111101, 111011, 110111, 101111, 1111111]
%e A327992 [7] [10001, 111001, 110101, 101101, 110011, 101011, 100111, 1111101, 1111011, 1110111, 1101111, 1011111, 11111111]
%e A327992 .
%e A327992 For instance, to compute T(7, 2) start with the composition [2, 3, 3]. Then take the conjugate, normalize the parts with 2 - c[j] and then represent the digits as an integer. The steps are:
%e A327992 [2, 3, 3] -> [1, 1, 2, 1, 2, 1] -> [1, 1, 0, 1, 0, 1] -> 110101 = T(7, 2).
%o A327992 (SageMath)
%o A327992 import functools
%o A327992 def alpha(P, Q): # order of compositions
%o A327992     if len(P) < len(Q): return int(-1)
%o A327992     if len(P) == len(Q):
%o A327992         for i in range(len(P)):
%o A327992             if P[i] < Q[i]: return int(-1)
%o A327992             if P[i] > Q[i]: return int(1)
%o A327992             return int(0)
%o A327992     return int(0)
%o A327992 def compositions(n):
%o A327992     A = [c.conjugate() for c in Compositions(n+1) if not(1 in c)]
%o A327992     B = [[2-i for i in a] for a in A]
%o A327992     sorted(B, key = functools.cmp_to_key(alpha))
%o A327992     return B
%o A327992 def Int(c): # convert to decimal integer representation
%o A327992     s = ""
%o A327992     for t in c: s += str(t)
%o A327992     return Integer(s) if s else 1
%o A327992 def A327992row(n):
%o A327992     if n == 0: return [1]
%o A327992     return [Int(c) for c in compositions(n)]
%o A327992 for n in (0..8): print(A327992row(n))
%Y A327992 Cf. A000045, A001629, A327993 (row sums).
%K A327992 nonn,tabf
%O A327992 0,2
%A A327992 _Peter Luschny_, Oct 12 2019