login
A020650
Numerators 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)).
19
1, 2, 1, 3, 1, 3, 2, 4, 1, 4, 3, 5, 2, 5, 3, 5, 1, 5, 4, 7, 3, 7, 4, 7, 2, 7, 5, 8, 3, 8, 5, 6, 1, 6, 5, 9, 4, 9, 5, 10, 3, 10, 7, 11, 4, 11, 7, 9, 2, 9, 7, 12, 5, 12, 7, 11, 3, 11, 8, 13, 5, 13, 8, 7, 1, 7, 6, 11, 5, 11, 6, 13, 4, 13, 9, 14, 5, 14, 9, 13, 3, 13, 10, 17, 7, 17, 10, 15, 4, 15, 11, 18, 7, 18
OFFSET
1,2
COMMENTS
The fractions are given in their reduced form, thus gcd(a(n), A020651(n)) = 1 for all n. - Antti Karttunen, May 26 2004
From Yosu Yurramendi, Jul 13 2014 : (Start)
If the terms (n>0) are written as an array (left-aligned fashion) with rows of length 2^m, m = 0,1,2,3,...
1,
2,1,
3,1,3,2,
4,1,4,3,5,2,5,3,
5,1,5,4,7,3,7,4, 7,2, 7,5, 8,3, 8,5,
6,1,6,5,9,4,9,5,10,3,10,7,11,4,11,7,9,2,9,7,12,5,12,7,11,3,11,8,13,5,13,8,
then the sum of the m-th row is 3^m (m = 0,1,2,), and each column is an arithmetic sequence.
If the rows are written in a right-aligned fashion:
1,
2,1,
3,1, 3,2,
4,1, 4,3, 5,2, 5,3,
5,1,5,4, 7,3, 7,4, 7,2, 7,5, 8,3, 8,5,
6,1,6,5,9,4,9,5,10,3,10,7,11,4,11,7,9,2,9,7,12,5,12,7,11,3,11,8,13,5,13,8,
each column k is a Fibonacci sequence. (End)
a(n2^m+1) = a(2n+1), n > 0, m > 0. - Yosu Yurramendi, Jun 04 2016
LINKS
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) = numerator of r(n).
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) = numerator of gamma_n.
FORMULA
a(1) = 1, a(2n) = a(n) + A020651(n), a(2n+1) = A020651(2n) = A020651(n). - Antti Karttunen, May 26 2004
a(2n) = A020651(2n+1). - Yosu Yurramendi, Jul 17 2014
a((2*n+1)*2^m + 1) = A086592(n), n > 0, m > 0. For n = 0, A086592(0) = 1 is needed. For m = 0, a(2*(n+1)) = A086592(n+1). - Yosu Yurramendi, Feb 19 2017
a(n) = A002487(1+A231551(n)), n > 0. - Yosu Yurramendi, Aug 07 2021
EXAMPLE
1, 2, 1/2, 3, 1/3, 3/2, 2/3, 4, 1/4, 4/3, ...
MAPLE
A020650 := n -> `if`((n < 2), n, `if`(type(n, even), A020650(n/2)+A020651(n/2), A020651(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_] := Numerator[f[n]]; Table[a[n], {n, 1, 94}] (* Jean-François Alcover, Nov 22 2011 *)
a[1]=1; a[2]=2; a[3]=1; a[n_] := a[n] = Switch[Mod[n, 4], 0, a[n/2+1] + a[n/2], 1, a[(n-1)/2+1], 2, a[(n-2)/2+1] + a[(n-2)/2], 3, a[(n-3)/2]]; Array[a, 100] (* Jean-François Alcover, Jan 22 2016, after Yosu Yurramendi *)
PROG
(Haskell)
import Data.List (transpose); import Data.Ratio (numerator)
a020650_list = map numerator ks where
ks = 1 : concat (transpose [map (+ 1) ks, map (recip . (+ 1)) ks])
-- Reinhard Zumkeller, Feb 22 2014
(R)
N <- 25 # arbitrary
a <- c(1, 2, 1)
for(n in 1:N){
a[4*n] <- a[2*n] + a[2*n+1]
a[4*n+1] <- a[2*n+1]
a[4*n+2] <- a[2*n] + a[2*n+1]
a[4*n+3] <- a[2*n]
}
a
# Yosu Yurramendi, Jul 13 2014
CROSSREFS
Cf. A020651.
Bisection: A086592.
Sequence in context: A303674 A038569 A308686 * A361373 A124224 A290089
KEYWORD
nonn,easy,frac,nice
STATUS
approved