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.

A244154 Permutation of natural numbers: a(0) = 1, a(1) = 2, a(2n) = A254049(a(n)), a(2n+1) = 3*a(n)-1; composition of A048673 and A005940.

This page as a plain text file.
%I A244154 #20 Feb 27 2021 21:32:21
%S A244154 1,2,3,5,4,8,13,14,6,11,18,23,25,38,63,41,7,17,28,32,39,53,88,68,61,
%T A244154 74,123,113,172,188,313,122,9,20,33,50,46,83,138,95,72,116,193,158,
%U A244154 270,263,438,203,85,182,303,221,424,368,613,338,666,515,858,563,1201,938,1563,365,10,26,43,59,60
%N A244154 Permutation of natural numbers: a(0) = 1, a(1) = 2, a(2n) = A254049(a(n)), a(2n+1) = 3*a(n)-1; composition of A048673 and A005940.
%C A244154 Note the indexing: the domain starts from 0, while the range excludes zero.
%C A244154 From _Antti Karttunen_, May 30 2017: (Start)
%C A244154 This sequence can be represented as a binary tree. Each left hand child is obtained by applying A254049(n) when the parent contains n, and each right hand child is obtained by applying A016789(n-1) (i.e., multiply by 3, subtract one) to the parent's contents:
%C A244154                                      1
%C A244154                                      |
%C A244154                   ...................2...................
%C A244154                  3                                       5
%C A244154        4......../ \........8                  13......../ \........14
%C A244154       / \                 / \                 / \                 / \
%C A244154      /   \               /   \               /   \               /   \
%C A244154     /     \             /     \             /     \             /     \
%C A244154    6       11         18       23         25       38         63       41
%C A244154   7 17   28  32     39  53   88  68     61  74  123  113   172  188  313 122
%C A244154 etc.
%C A244154 This is a mirror image of the tree depicted in A245612.
%C A244154 (End)
%H A244154 Antti Karttunen, <a href="/A244154/b244154.txt">Table of n, a(n) for n = 0..8192</a>
%H A244154 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A244154 a(n) = A048673(A005940(n+1)).
%F A244154 From _Antti Karttunen_, May 30 2017: (Start)
%F A244154 a(0) = 1, a(1) = 2, a(2n) = A254049(a(n)), a(2n+1) = 3*a(n)-1.
%F A244154 a(n) = A245612(A054429(n)).
%F A244154 (End)
%o A244154 (Scheme)
%o A244154 (define (A244154 n) (A048673 (A005940 (+ 1 n))))
%o A244154 ;; Implementing a new recurrence, with memoization-macro definec:
%o A244154 (definec (A244154 n) (cond ((<= n 1) (+ 1 n)) ((even? n) (A254049 (A244154 (/ n 2)))) (else (+ -1 (* 3 (A244154 (/ (- n 1) 2))))))) ;; _Antti Karttunen_, May 30 2017
%Y A244154 Inverse: A244153.
%Y A244154 Cf. A005940, A048673, A054429, A243065-A243066, A243505-A243506, A245608, A245610, A245612, A016789, A254049, A285712, A285714, A286613.
%K A244154 nonn,tabf
%O A244154 0,2
%A A244154 _Antti Karttunen_, Jun 27 2014