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.

A162909 Numerators of Bird tree fractions.

This page as a plain text file.
%I A162909 #49 Apr 24 2024 09:41:07
%S A162909 1,1,2,2,1,3,3,3,3,1,2,5,4,4,5,5,4,4,5,2,1,3,3,8,7,5,7,7,5,7,8,8,7,5,
%T A162909 7,7,5,7,8,3,3,1,2,5,4,4,5,13,11,9,12,9,6,10,11,11,10,6,9,12,9,11,13,
%U A162909 13,11,9,12,9,6,10,11,11,10,6,9,12,9,11,13,5,4,4,5,2,1,3,3,8,7,5,7,7,5,7,8
%N A162909 Numerators of Bird tree fractions.
%C A162909 The Bird tree is an infinite binary tree labeled with rational numbers. The root is labeled with 1. The tree enjoys the following fractal property: it can be transformed into its left subtree by first incrementing and then reciprocalizing the elements; for the right subtree interchange the order of the two steps: the elements are first reciprocalized and then incremented. Like the Stern-Brocot tree, the Bird tree enumerates all the positive rationals (A162909(n)/A162910(n)).
%C A162909 From _Yosu Yurramendi_, Jul 11 2014: (Start)
%C A162909 If the terms (n>0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
%C A162909 1,
%C A162909 1,2,
%C A162909 2,1,3,3,
%C A162909 3,3,1,2,5,4,4,5,
%C A162909 5,4,4,5,2,1,3,3,8,7,5,7,7,5,7,8,
%C A162909 8,7,5,7,7,5,7,8,3,3,1,2,5,4,4,5,13,11,9,12,9,6,10,11,11,10,6,9,12,9,11,13,
%C A162909 then the sum of the m-th row is 3^m (m = 0,1,2,), each column k is a Fibonacci sequence.
%C A162909 If the rows are written in a right-aligned fashion:
%C A162909                                                                         1,
%C A162909                                                                      1, 2,
%C A162909                                                                 2,1, 3, 3,
%C A162909                                                       3, 3,1,2, 5,4, 4, 5,
%C A162909                                  5, 4,4, 5,2,1, 3, 3, 8, 7,5,7, 7,5, 7, 8,
%C A162909 8,7,5,7,7,5,7,8,3,3,1,2,5,4,4,5,13,11,9,12,9,6,10,11,11,10,6,9,12,9,11,13,
%C A162909 then each column k also is a Fibonacci sequence.
%C A162909 The Fibonacci sequences of both triangles are equal except the first terms of first triangle.
%C A162909 If the sequence is considered by blocks of length 2^m, m = 0,1,2,..., the blocks of this sequence are the reverses of blocks of A162910 ( a(2^m+k) = A162910(2^(m+1)-1-k), m = 0,1,2,..., k = 0,1,2,...,2^m-1).
%C A162909 (End)
%H A162909 R. Hinze, <a href="http://www.cs.ox.ac.uk/ralf.hinze/publications/Bird.pdf">Functional pearls: the bird tree</a>, J. Funct. Programming 19 (2009), no. 5, 491-508.
%H A162909 <a href="/index/Fo#fraction_trees">Index entries for fraction trees</a>
%F A162909 a(2^m+k) = a(2^m-k-1), a(2^m+2^(m-1)+k) = a(2^m+k) + a(2^(m-1)+k), a(1) = 1, m=0,1,2,3,..., k=0,1,...,2^(m-1)-1. - _Yosu Yurramendi_, Jul 11 2014
%F A162909 a(A097072(n)*2^m+k) = A268087(2^m+k), m >= 0, 0 <= k < 2^m, n > 1. a(A000975(n)) = 1, n > 0. - _Yosu Yurramendi_, Feb 21 2017
%F A162909 a(n) = A002487(A258996(A059893(n))) = A002487(A059893(A258746(n))), n > 0. - _Yosu Yurramendi_, Jul 14 2021
%e A162909 The first four levels of the Bird tree: [1/1] [1/2, 2/1] [2/3, 1/3, 3/1, 3/2], [3/5, 3/4, 1/4, 2/5, 5/2, 4/1, 4/3, 5/3].
%o A162909 (Haskell)
%o A162909 import Ratio
%o A162909 bird :: [Rational]
%o A162909 bird = branch (recip . succ) (succ . recip) 1
%o A162909 branch f g a = a : branch f g (f a) \/ branch f g (g a)
%o A162909 (a : as) \/ bs = a : (bs \/ as)
%o A162909 a162909 = map numerator bird
%o A162909 a162910 = map denominator bird
%o A162909 (R)
%o A162909 blocklevel <- 6 # arbitrary
%o A162909 a <- 1
%o A162909 for(m in 1:blocklevel) for(k in 0:(2^(m-1)-1)){
%o A162909 a[2^m+k]         = a[2^m-k-1]
%o A162909 a[2^m+2^(m-1)+k] = a[2^m+k] + a[2^(m-1)+k]
%o A162909 }
%o A162909 a
%o A162909 # _Yosu Yurramendi_, Jul 11 2014
%Y A162909 This sequence is the composition of A162911 and A059893: a(n) = A162911(A059893(n)). This sequence is a permutation of A002487(n+1).
%K A162909 easy,frac,nonn
%O A162909 1,3
%A A162909 Ralf Hinze (ralf.hinze(AT)comlab.ox.ac.uk), Aug 05 2009