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.

Previous Showing 11-15 of 15 results.

A345253 Maximal Fibonacci tree: Arrangement of the positive integers as labels of a complete binary tree.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 7, 9, 10, 13, 11, 14, 16, 21, 12, 15, 17, 22, 18, 23, 26, 34, 19, 24, 27, 35, 29, 37, 42, 55, 20, 25, 28, 36, 30, 38, 43, 56, 31, 39, 44, 57, 47, 60, 68, 89, 32, 40, 45, 58, 48, 61, 69, 90, 50, 63, 71, 92, 76, 97, 110, 144, 33, 41, 46, 59, 49
Offset: 1

Views

Author

J. Parker Shectman, Jun 12 2021

Keywords

Comments

Every positive integer occurs exactly once, so that, as a sequence, a(n) is a permutation of the positive integers.
Descending from the root node 1, generate tree by outer composition of L(n) = n + F(Finv(n)) and R(n) = n + F(Finv(n) + 1), respectively, according to left or right branching, where F(n) = A000045(n) are the Fibonacci numbers and Finv(n) = A130233(n) is the 'lower' Fibonacci inverse. This produces each number by maximal Fibonacci expansion (cf. example below of Method 2, entry A343152, and links).
(Level of tree): The number of terms in this expansion of n is the level of the tree on which n appears, A112310(n-1) + 1 = A200648(n+1). The number of terms in the expansion of a(n) is floor(log_2(n)) + 1 = A113473(n) = A070939(n) = A029837(n+1).
"Maximal Fibonacci expansion" maximizes the sum of coefficients over all Fibonacci numbers (of positive index), allowing both F(1) = 1 and F(2) = 1. Thus, it is just an expansion and not a representation (like "greedy" and "lazy"), as it "breaks the rule" by using two bits that correspond to elements of equal value, rather than using distinct basis elements (link). This reveals connections to the cf. sequences: Binary strings that emerge in lexicographic order from "maximal Fibonacci gaps" (example), binary trees of the positive integers, and I-D arrays "harvested" from the trees. To define the expansion uniquely, always include F(1), so that the expansion of positive integer n equals F(1) for n = 1 and F(1) prepended to the lazy Fibonacci representation of n-1 for n > 1. Hence, a(1) = 1, and for n > 1, a(n) = A095903(n-1) + 1. The "redundant" expansion arranges the positive integers in the single binary tree {T(n,k)}, rather than the two trees at A255773 and A255774 that result from representation (see link).
(Left-to-right order in tree): Each F(t)-sized block (F(t+1), ..., F(t+2) - 1) of successive positive integers ("Fibonacci cohort" t) appears in right-to-left order in the tree as reordered in A343152, where elements of each cohort appear consecutively (see link).
Descending from the root node 1, generate tree by the inner composition of A026351 and A026352, that is, one plus the sequences of lower and upper Wythoff numbers, A000201 and A001950, respectively, according to left or right branching (see example below of Method 1 and links).
Generate tree from (one plus) the number of (initial) zeros on the positive integers for the outer composition of sequences, A060143 and A060144, respectively, according to left or right branching descending from the identity (c.f example below of Method 3 and links).
The lower Wythoff numbers, A000201, appear exclusively in the 1st, 3rd, 5th, ... right clades of the tree, while the upper Wythoff numbers A001950, appear exclusively in the 2nd, 4th, 6th, ... right clades of the tree. Here, the k-th right clade comprises the nodes at positions 2^(k+1) and 2^k + 1, together with all descendants of the latter (link).
(Duality with tree A232560, and related arrays): Consider the labeled binary trees a(n) = A232560(A059893(n)) and A232560(n) = a(A059893(n)). Labels along maximal straight paths that always branch left in a(n) give rows of array A345252, while labels along maximal straight paths that always branch left in A232560 give rows of array A083047.
Sorting the labels from each successive right clade of the binary tree a(n) gives the successive columns of A083047, while sorting labels from each successive right clade of A232560 gives each successive column of A345252. This makes the trees a(n) and A232560 "blade-duals," blade being a contraction of branch-clade (see entry for A345254 and link). A200648(n)+1 gives the level of the tree on which elements of array first-columns A345252(n,1) and A083047(n,1) appear.
(Palindromes and coincidence of elements): Trees a(n) and A232560 coincide when the sequence of left and right branching is a palindrome: a(A329395(n)) = A232560(A329395(n)). As Kimberling notes (cf. A059893), this happens at fixed points of A059893(n) or, equivalently, at n for which A081242(n) is a palindrome.
The inverse permutation of a(n) as a sequence can be read from a "tetrangle" or "irregular triangle" tableau with F(t) (Fibonacci number) entries on each row t, for t = 1, 2, 3, ..., in which an entry on row t is 2*x the entry x immediately above it on row t-1, if such exists, or otherwise 2*x + 1 the entry x in the corresponding position on row t-2 (thus generating new rows as in A243571 but without sorting the numbers into increasing order, linked reference):
1,
2,
3, 4,
5, 6, 8,
7, 9, 10, 12, 16,
11, 13, 17, 14, 18, 20, 24, 32,
...
With the right-justified tableau substituted by a left-justified tableau, the same procedure yields the inverse permutation for the "minimal Fibonacci tree," A048680(A059893(n)), the "cohort-dual" tree of a(n), where "cohort" t is the F(t)-sized block of successive entries in the tableau (see entry for A345252, linked reference).
(Coincidence of elements): a(A020988(n)) = A048680(A059893(A020988(n))) = A099919(n) and a(A020989(n)) = A048680(A059893(A020989(n))) = A049651(n). Collectively, a(A061547(n)) = A048680(A059893(A061547(n))) = union(A049651(n), A099919(n)).
With two types of duality, the tree forms a quartet of binary-tree arrangements of the positive integers, together with its blade dual A232560, its cohort dual A048680(A059893), and blade dual A048680 of the latter.
Order in the tree is "memory-less": Let a(n) and a(m) label nodes at positions n and m, respectively. Let d1 and d2 be two descending paths, i.e., sequences branching left or right from a starting node. (Nodal positions for the left and right children of the node at position p are given by 2*p and 2*p + 1, resp., and d1 and d2 are compositions of these.) Then a(d1(n)) < a(d2(n)) if and only if a(d1(m)) < a(d2(m)) (linked reference).

Examples

			As a complete binary tree:
                    1
           /                 \
          2                   3
      /       \          /        \
     4         5        6          8
    / \       / \      / \        / \
   7    9    10   13   11   14   16   21
  / \  / \  /  \ /  \ /  \ /  \ /  \ /  \
  ...
By maximal Fibonacci expansion:
                                        F(1)
                      /                                       \
                F(1) + F(2)                               F(1) + F(3)
           /                    \                    /                  \
  F(1) + F(2) + F(3)   F(1) + F(2) + F(4)   F(1) + F(3) + F(4)   F(1) + F(3) + F(5)
  ...
"Fibonacci gaps," or differences between successive indices in maximal Fibonacci expansion above, are A007931(n-1) for n > 1 (see link):
                   *
          /                  \
         1                    2
     /       \           /        \
    11        12        21        22
   /  \      /  \      /  \      /  \
  111  112  121  122  211  212  221  222
  / \  / \  / \  / \  / \  / \  / \  / \
  ...
In examples of the three methods below:
Branch left-right-right down the tree to arrive at nodal position n = 2*(2*(2*1) + 1) + 1 = 11;
Branch right-left-left down the tree to arrive at nodal position n = 2*(2*(2*1 + 1)) = 12.
Tree by inner composition of (one plus) the lower and upper Wythoff sequences, A000201 and A001950 (Method 1):
a(11) = A000201(A001950(A001950(1) + 1) + 1) + 1 = 13.
a(12) = A001950(A000201(A000201(1) + 1) + 1) + 1 = 11.
Tree by (outer) composition of branching functions L(n) = n + F(Finv(n)) and R(n) = n + F(Finv(n) + 1), where F(n) = A000045(n) and Finv(n) = A130233(n) (Method 2):
a(11) = R(R(L(1))) = 13.
a(12) = L(R(R(1))) = 11.
Tree by outer composition of A060143 and A060144 (Wythoff inverse sequences) (Method 3):
a(11) = 13, position of first nonzero in A060144(A060144(A060143(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
a(12) = 11, position of first nonzero in A060143(A060143(A060144(m))) = 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, ..., for m = 1, 2, 3, ....
		

Crossrefs

Programs

  • Mathematica
    (* For binary tree implementations, see supporting file under LINKS *)
    a[n_] := (x = 0; y = 0; BDn = Reverse[IntegerDigits[n, 2]]; imax = Length[BDn] - 1; For[i = 0, i <= imax, i++, {x, y} = {y + 1, x + y}; If[BDn[[i + 1]] == 1, {x, y} = {y, x + y}]]; y);
    (* Adapted from PARI code of Kevin Ryde *)
  • PARI
    a(n) = my(x=0,y=0); for(i=0,logint(n,2), [x,y]=[y+1,x+y]; if(bittest(n,i), [x,y]=[y,x+y])); y; \\ Kevin Ryde, Jun 19 2021

Formula

a(1) = 1 and for n > 1, a(n) = A095903(n-1) + 1.
a(n) = A232560(A059893(n)).

A056017 Permutation of nonnegative integers formed by ranking fibbinary numbers (A003714) as if they were representatives of the circular binary sequences with forbidden -11- subsequence.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 7, 6, 8, 11, 9, 10, 12, 13, 18, 14, 15, 19, 16, 20, 17, 21, 29, 22, 23, 30, 24, 31, 25, 26, 32, 27, 28, 33, 34, 47, 35, 36, 48, 37, 49, 38, 39, 50, 40, 41, 51, 42, 52, 43, 44, 53, 45, 54, 46, 55, 76, 56, 57, 77, 58, 78, 59, 60, 79, 61, 62, 80, 63, 81, 64, 65
Offset: 0

Views

Author

Antti Karttunen, Jun 08 2000

Keywords

Comments

Function CircBinSeqNo11Rank gives the position of any 11-free binary sequence in this sequence, where each block consists of Lucas(n-2) sequences of length n: (either the leftmost or the rightmost digit is 1, but not both).
In this permutation the Fibonacci numbers themselves (A000045) are fixed.

Examples

			0; 01,10; 100; 0101,1000,1010; 01001,10000,10010,10100; 010001,010101,100000,100010,100100,101000,101010; etc.
		

Crossrefs

Inverse permutation: A056018. For fibbinary function see A048679, interpret_as_zeckendorf_expansion given in A048680.

Programs

  • Maple
    CircBinSeqNo11Rank := n -> fibonacci(floor_log_2(n)+1-((-1)^n)) + interpret_as_zeckendorf_expansion(floor(n/(3-((-1)^n))));

Formula

[seq(CycBinSeqNo11Rank(fibbinary(j)), j=0..233)];
a[0] = 0, a[n] = CircBinSeqNo11Rank(fibbinary(n)) for n >= 1.

A352416 A permutation related to minimal Pell representations: append a 0 after each 2 in the ternary expansion of n, and then replace each place value, say 3^k with k >= 0, by A000129(k+1).

Original entry on oeis.org

0, 1, 4, 2, 3, 9, 10, 11, 28, 5, 6, 16, 7, 8, 21, 22, 23, 57, 24, 25, 62, 26, 27, 67, 68, 69, 168, 12, 13, 33, 14, 15, 38, 39, 40, 98, 17, 18, 45, 19, 20, 50, 51, 52, 127, 53, 54, 132, 55, 56, 137, 138, 139, 337, 58, 59, 144, 60, 61, 149, 150, 151, 366, 63, 64
Offset: 0

Views

Author

Rémy Sigrist, Mar 15 2022

Keywords

Comments

This sequence is to Pell numbers what A048680 is to Fibonacci numbers.
This sequence is a permutation of the nonnegative integers, with inverse A352417.

Examples

			For n = 7:
- the ternary expansion of 7 is "21",
- after appending 0's, we obtain "201",
- so a(7) = 2*A000129(2+1) + 0*A000129(1+1) + 1*A000129(0+1) = 2*5 + 1*1 = 11.
		

Crossrefs

Cf. A000129, A048680, A317204, A352417 (inverse).

Programs

  • PARI
    a(n) = { my (v=0, t=0, d); for (k=0, oo, if (n, d=n%3; n\=3; if (d==2, t++); if (d, v+=d*([2, 1; 1, 0]^(k+1+t))[2, 1]), return (v))) }

A379657 The nonadjacent form of a(n) is obtained by inserting a digit 0 before each nonzero digit in the balanced ternary expansion of n.

Original entry on oeis.org

0, 1, 3, 2, 5, 11, 6, 13, 7, 4, 9, 19, 10, 21, 43, 22, 45, 23, 12, 25, 51, 26, 53, 27, 14, 29, 15, 8, 17, 35, 18, 37, 75, 38, 77, 39, 20, 41, 83, 42, 85, 171, 86, 173, 87, 44, 89, 179, 90, 181, 91, 46, 93, 47, 24, 49, 99, 50, 101, 203, 102, 205, 103, 52, 105
Offset: 0

Views

Author

Rémy Sigrist, Dec 29 2024

Keywords

Comments

A permutation of the nonnegative integers with inverse A379658.

Examples

			The first terms are:  n   a(n)  bter(n)  naf(a(n))
  --  ----  -------  ---------
   0     0        0          0
   1     1        1          1
   2     3       1T        10T
   3     2       10         10
   4     5       11        101
   5    11      1TT      10T0T
   6     6      1T0       10T0
   7    13      1T1      10T01
   8     7      10T       100T
   9     4      100        100
  10     9      101       1001
  11    19      11T      1010T
  12    10      110       1010
		

Crossrefs

See A048680 for a similar sequence.
Cf. A065363, A334913, A379658 (inverse).

Programs

  • PARI
    a(n) = { my (v = 0, d, b = 1); while (n, d = centerlift(Mod(n, 3)); n = (n-d)/3;
     v += d * b; b *= if (d, 4, 2);); v; }

Formula

A334913(a(n)) = A065363(n).

A371163 Numbers that remain unchanged when converted to their compressed fibbinary numbers.

Original entry on oeis.org

0, 1, 2, 9, 10, 115544, 13568075, 13568077, 13568078, 13568083, 13568085, 13568086
Offset: 1

Views

Author

Douglas Boffey, Mar 13 2024

Keywords

Examples

			9 is a term since 9 = 8 + 1 = F(6) + F(2), where F(i) is the i-th Fibonacci number, is Fibbinary A003714(9) = 10001_2, but then all '01's are compressed to '1', leaving A048679(9) = 1001_2, which is 9 itself again.
		

Crossrefs

Fixed points of A048679 and A048680.

Programs

  • Python
    from itertools import count, islice
    def A371163_gen(): # generator of terms
        c = 0
        for n in count(0):
            if not (n<<1)&n:
                if  int(bin(n)[2:].replace('01','1'),2) == c:
                    yield c
                c += 1
    A371163_list = list(islice(A371163_gen(),6)) # Chai Wah Wu, Mar 18 2024
Previous Showing 11-15 of 15 results.