A162910 Denominators of Bird tree fractions.
1, 2, 1, 3, 3, 1, 2, 5, 4, 4, 5, 2, 1, 3, 3, 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, 5, 4, 4, 5, 2, 1, 3, 3, 8, 7, 5, 7, 7, 5, 7, 8, 21, 18, 14, 19, 16, 11, 17, 19, 14, 13, 7, 11, 17, 13, 15, 18, 18, 15, 13, 17, 11, 7, 13, 14, 19
Offset: 1
Examples
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].
Links
- Ralf Hinze, Functional pearls: the bird tree, J. Funct. Programming 19 (2009), no. 5, 491-508.
- Index entries for fraction trees
Crossrefs
Programs
-
Haskell
import Ratio; bird :: [Rational]; bird = branch (recip . succ) (succ . recip) 1; branch f g a = a : branch f g (f a) \/ branch f g (g a); (a : as) \/ bs = a : (bs \/ as); a162909 = map numerator bird; a162910 = map denominator bird
-
R
blocklevel <- 6 # arbitrary a <- 1 for(m in 1:blocklevel) for(k in 0:(2^(m-1)-1)){ a[2^m+k] = a[2^m-k-1] + a[2^(m-1)+k] a[2^m+2^(m-1)+k] = a[2^m-k-1] } a # Yosu Yurramendi, Jul 11 2014
Formula
a(2^m+k) = a(2^m-k-1) + a(2^(m-1)+k), a(2^m+2^(m-1)+k) = a(2^m-k-1), a(1) = 1, m=0,1,2,3,..., k=0,1,...,2^(m-1)-1. - Yosu Yurramendi, Jul 11 2014
Comments