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.

A245327 Numerators in recursive bijection from positive integers to positive rationals, where the bijection is f(1) = 1, f(2n) = 1/(f(n)+1), f(2n+1) = f(n)+1.

This page as a plain text file.
%I A245327 #38 Apr 25 2024 12:15:16
%S A245327 1,1,2,2,3,1,3,3,5,2,5,3,4,1,4,5,8,3,8,5,7,2,7,4,7,3,7,4,5,1,5,8,13,5,
%T A245327 13,8,11,3,11,7,12,5,12,7,9,2,9,7,11,4,11,7,10,3,10,5,9,4,9,5,6,1,6,
%U A245327 13,21,8,21,13,18,5,18,11,19,8,19,11,14,3,14,12,19,7,19,12,17,5,17,9,16,7,16,9,11,2,11,11,18,7,18,11
%N A245327 Numerators in recursive bijection from positive integers to positive rationals, where the bijection is f(1) = 1, f(2n) = 1/(f(n)+1), f(2n+1) = f(n)+1.
%C A245327 a(n)/A245328(n) enumerates all the reduced nonnegative rational numbers exactly once.
%C A245327 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 A245327    1,
%C A245327    1, 2,
%C A245327    2, 3,1, 3,
%C A245327    3, 5,2, 5,3, 4,1, 4,
%C A245327    5, 8,3, 8,5, 7,2, 7,4, 7,3, 7,4,5,1,5,
%C A245327    8,13,5,13,8,11,3,11,7,12,5,12,7,9,2,9,7,11,4,11,7,10,3,10,5,9,4,9,5,6,1,6,
%C A245327 then the sum of the m-th row is 3^m (m = 0,1,2,), and each column k is a Fibonacci sequence.
%C A245327 If the rows are written in a right-aligned fashion:
%C A245327                                                                         1,
%C A245327                                                                       1,2,
%C A245327                                                                   2,3,1,3,
%C A245327                                                           3,5,2,5,3,4,1,4,
%C A245327                                       5, 8,3, 8,5, 7,2, 7,4,7,3,7,4,5,1,5,
%C A245327 8,13,5,13,8,11,3,11,7,12,5,12,7,9,2,9,7,11,4,11,7,10,3,10,5,9,4,9,5,6,1,6,
%C A245327 then each column is an arithmetic sequence.
%C A245327 If the sequence is considered by blocks of length 2^m, m = 0,1,2,..., the blocks of this sequence are permutations of terms of blocks from A002487 (Stern's diatomic series or Stern-Brocot sequence), and, more precisely, the reverses of blocks of A020650 ( a(2^m+k) = A020650(2^(m+1)-1-k), m = 0,1,2,..., k = 0,1,2,...,2^m-1).
%C A245327 Moreover, each block is the bit-reversed permutation of the corresponding block of A245325.
%H A245327 Michael De Vlieger, <a href="/A245327/b245327.txt">Table of n, a(n) for n = 1..16383</a>, rows 1-14, flattened.
%H A245327 <a href="/index/Fo#fraction_trees">Index entries for fraction trees</a>
%F A245327 a(2n) = A245328(2n+1) , a(2n+1) = A245328(2n) , n=0,1,2,3,...
%F A245327 a((2*n+1)*2^m - 2) = A273493(n), n > 0, m > 0. For n = 0, m > 0, A273493(0) = 1 is needed. For n = 1, m = 0, A273493(0) = 1 is needed. For n > 1, m = 0, numerator((2*n-1) = num+den(n-1). - _Yosu Yurramendi_, Mar 02 2017
%F A245327 a(n) = A002487(A284459(n)). - _Yosu Yurramendi_, Aug 23 2021
%t A245327 f[n_] := Which[n == 1, 1, EvenQ@ n, 1/(f[n/2] + 1), True, f[(n - 1)/2] + 1]; Table[Numerator@ f@ k, {n, 7}, {k, 2^(n - 1), 2^n - 1}] // Flatten (* _Michael De Vlieger_, Mar 02 2017 *)
%o A245327 (R)
%o A245327 N  <- 25 # arbitrary
%o A245327 a <- c(1,1,2)
%o A245327 for(n in 1:N){
%o A245327   a[4*n]   <-          a[2*n+1]
%o A245327   a[4*n+1] <- a[2*n] + a[2*n+1]
%o A245327   a[4*n+2] <- a[2*n]
%o A245327   a[4*n+3] <- a[2*n] + a[2*n+1]
%o A245327 }
%o A245327 a
%o A245327 (PARI) a(n) = my(A=0); forstep(i=logint(n, 2), 0, -1, if(bittest(n, i), A++, A=1/(A+1))); numerator(A) \\ _Mikhail Kurkov_, Mar 12 2023
%Y A245327 Cf. A002487, A020651, A245325, A245328, A273493.
%K A245327 nonn,frac
%O A245327 1,3
%A A245327 _Yosu Yurramendi_, Jul 18 2014