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.

A284459 Permutation of the positive integers: this permutation transforms the enumeration system of positive irreducible fractions A002487/A002487' (Calkin-Wilf) into the enumeration system A245327/A245328, and A162911/A162912 (Drib) into A020651/A020650 (Yu-Ting inverted).

This page as a plain text file.
%I A284459 #19 May 28 2021 21:53:42
%S A284459 1,2,3,6,5,4,7,10,13,12,11,14,9,8,15,26,21,20,27,22,25,24,23,18,29,28,
%T A284459 19,30,17,16,31,42,53,52,43,54,41,40,55,50,45,44,51,46,49,48,47,58,37,
%U A284459 36,59,38,57,56,39,34,61,60,35,62,33,32,63
%N A284459 Permutation of the positive integers: this permutation transforms the enumeration system of positive irreducible fractions A002487/A002487' (Calkin-Wilf) into the enumeration system A245327/A245328, and A162911/A162912 (Drib) into A020651/A020650 (Yu-Ting inverted).
%C A284459 The inverse permutation is A284460.
%H A284459 Yosu Yurramendi, <a href="/A284459/b284459.txt">Table of n, a(n) for n = 1..16383</a>
%H A284459 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A284459 a(n) = A258996(A231551(n)) = A231551(A092569(n)), n > 0 . - _Yosu Yurramendi_, Apr 10 2017
%o A284459 (R)
%o A284459 maxrow <- 12 # by choice
%o A284459 a <- 1
%o A284459 b01 <- 1
%o A284459 for(m in 0:maxrow){
%o A284459   b01 <- c(b01, c(1-b01[2^m:(2^(m+1)-1)], b01[2^m:(2^(m+1)-1)]) )
%o A284459   for(k in 0:(2^m-1)){
%o A284459     a[2^(m+1) +       k] <- a[2^m + k] + 2^(m + b01[2^(m+1) +       k])
%o A284459     a[2^(m+1) + 2^m + k] <- a[2^m + k] + 2^(m + b01[2^(m+1) + 2^m + k])
%o A284459 }}
%o A284459 a
%o A284459 # _Yosu Yurramendi_, Mar 27 2017
%o A284459 (R)
%o A284459 maxblock <- 7 # by choice
%o A284459 a <- 1:3
%o A284459 for(n in 4:2^maxblock){
%o A284459 ones <- which(as.integer(intToBits(n)) == 1)
%o A284459 nbit <- as.integer(intToBits(n))[1:tail(ones, n = 1)]
%o A284459 anbit <- nbit
%o A284459 for(i in 2:(length(anbit) - 1))
%o A284459    anbit[i] <- 1 - bitwXor(anbit[i], anbit[i-1])
%o A284459 a <- c(a, sum(anbit*2^(0:(length(anbit) - 1))))
%o A284459 }
%o A284459 a
%o A284459 # _Yosu Yurramendi_, Apr 25 2021
%Y A284459 Cf. A002487, A020650, A020651, A162911, A162912, A245327, A245328, A284460.
%K A284459 nonn
%O A284459 1,2
%A A284459 _Yosu Yurramendi_, Mar 27 2017