|
|
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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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
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)
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
1, 2, 1/2, 3, 1/3, 3/2, 2/3, 4, 1/4, 4/3, ...
|
|
MAPLE
|
|
|
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])
(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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,frac,nice,changed
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|