A020651 Denominators in recursive bijection from positive integers to positive rationals (the bijection is f(1) = 1, f(2n) = f(n)+1, f(2n+1) = 1/(f(n)+1)).
1, 1, 2, 1, 3, 2, 3, 1, 4, 3, 4, 2, 5, 3, 5, 1, 5, 4, 5, 3, 7, 4, 7, 2, 7, 5, 7, 3, 8, 5, 8, 1, 6, 5, 6, 4, 9, 5, 9, 3, 10, 7, 10, 4, 11, 7, 11, 2, 9, 7, 9, 5, 12, 7, 12, 3, 11, 8, 11, 5, 13, 8, 13, 1, 7, 6, 7, 5, 11, 6, 11, 4, 13, 9, 13, 5, 14, 9, 14, 3, 13, 10, 13, 7, 17, 10, 17, 4, 15, 11, 15, 7, 18, 11
Offset: 1
Examples
1, 2, 1/2, 3, 1/3, 3/2, 2/3, 4, 1/4, 4/3, ...
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- D. N. Andreev, On a Wonderful Numbering of Positive Rational Numbers, Matematicheskoe Prosveshchenie, Series 3, volume 1, 1997, pages 126-134 (in Russian). a(n) = denominator of r(n).
- Godofredo Iommi and Mario Ponce, Odometers in non-compact spaces, arXiv:2404.03768 [math.DS], 2024. See p. 19.
- Johannes Kepler, Excerpt from the Chapter II of the Book III of the Harmony of the World: On the seven harmonic divisions of the string (illustrates the A020651/A086592-tree).
- Pelegrí Viader, Jaume Paradís and Lluís Bibiloni, A New Light on Minkowski's ?(x) Function, J. Number Theory, 73 (2) (1998), 212-227. See p. 215.
- Shen Yu-Ting, A Natural Enumeration of Non-Negative Rational Numbers -- An Informal Discussion, American Mathematical Monthly, volume 87, number 1, January 1980, pages 25-29. a(n) = denominator of gamma_n.
- Index entries for fraction trees
- Index entries for sequences related to music
Crossrefs
Programs
-
Haskell
import Data.List (transpose); import Data.Ratio (denominator) a020651_list = map denominator ks where ks = 1 : concat (transpose [map (+ 1) ks, map (recip . (+ 1)) ks]) -- Reinhard Zumkeller, Feb 22 2014
-
Maple
A020651 := n -> `if`((n < 2),n,`if`(type(n,even), A020651(n/2), A020650(n-1)));
-
Mathematica
f[1] = 1; f[n_?EvenQ] := f[n] = f[n/2]+1; f[n_?OddQ] := f[n] = 1/(f[(n-1)/2]+1); a[n_] := Denominator[f[n]]; Table[a[n], {n, 1, 94}] (* Jean-François Alcover, Nov 22 2011 *)
-
R
N <- 25 # arbitrary a <- c(1,1,2) for(n in 1:N){ a[4*n] <- a[2*n] a[4*n+1] <- a[2*n] + a[2*n+1] a[4*n+2] <- a[2*n+1] a[4*n+3] <- a[2*n] + a[2*n+1] } a # Yosu Yurramendi, Jul 13 2014
Formula
a(1) = 1, a(2n) = a(n), a(2n+1) = A020650(2n). - Antti Karttunen, May 26 2004
a(2n) = A020650(2n+1). - Yosu Yurramendi, Jul 17 2014
a(2^m + k) = A093873(2^(m+1) + k) = A093873(2^(m+1) + 2^m + k), m >= 0, 0 <= k < 2^m. - Yosu Yurramendi, May 18 2016
a(2^m + 2^r + k) = A093873(2^r + k)*(m-(r-1)) + A093873(k), m >= 0, r <= m-1, 0 <= k < 2^r. For k=0 A093873(0) = 0 is needed. - Yosu Yurramendi, Jul 30 2016
a((2n+1)*2^m) = A086592(n), m >= 0, n > 0. For n = 0 A086592(0) = 1 is needed. - Yosu Yurramendi, Feb 14 2017
a(4n+2) = a(4n+1) - a(4n) = a(2n+1) = a(4n+1) - a(n), n > 0. - Yosu Yurramendi, May 08 2018
a(1) = 1, a(n+1) = 2*floor(1/a(n))+1-1/a(n). - Jan Malý, Jul 30 2019
Extensions
Entry revised by N. J. A. Sloane, May 24 2004
Comments