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.
%I A269377 #9 Mar 07 2016 12:22:09 %S A269377 1,2,3,4,7,6,5,8,9,14,11,12,19,10,17,16,13,18,35,28,39,22,29,24,27,38, %T A269377 23,20,61,34,41,32,15,26,47,36,123,70,77,56,57,78,59,44,103,58,65,48, %U A269377 45,54,107,76,81,46,53,40,91,122,95,68,145,82,89,64,21,30,71,52,165,94,101,72,183,246,203,140,271,154,161,112,97 %N A269377 Tree of Lucky sieve: a(0) = 1, a(1) = 2; after which a(2n) = A269369(a(n)), a(2n+1) = 2*a(n). %C A269377 Permutation of natural numbers obtained from the Lucky sieve. Note the indexing: Domain starts from 0, range from 1. %C A269377 This sequence can be represented as a binary tree. After a(1)=2, each left hand child is obtained by applying A269369 to the parent, and each right hand child is obtained by doubling the contents of the parent node, when the parent node contains n: %C A269377 1 %C A269377 | %C A269377 ...................2................... %C A269377 3 4 %C A269377 7......../ \........6 5......../ \........8 %C A269377 / \ / \ / \ / \ %C A269377 / \ / \ / \ / \ %C A269377 / \ / \ / \ / \ %C A269377 9 14 11 12 19 10 17 16 %C A269377 13 18 35 28 39 22 29 24 27 38 23 20 61 34 41 32 %C A269377 etc. %C A269377 Sequence A269375 is obtained from the mirror image of the same tree. %H A269377 Antti Karttunen, <a href="/A269377/b269377.txt">Table of n, a(n) for n = 0..4095</a> %H A269377 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a> %F A269377 a(0) = 1, a(1) = 2; after which, a(2n) = A269369(a(n)), a(2n+1) = 2*a(n). %F A269377 As a composition of related permutations: %F A269377 a(n) = A260742(A269387(n)). %o A269377 (Scheme, with memoization-macro definec) %o A269377 (definec (A269377 n) (cond ((<= n 2) (+ 1 n)) ((even? n) (A269369 (A269377 (/ n 2)))) (else (* 2 (A269377 (/ (- n 1) 2)))))) %Y A269377 Inverse: A269378. %Y A269377 Cf. A269369. %Y A269377 Cf. A000959 (with 2 inserted between 1 and 3 forms the left edge of the tree). %Y A269377 Related permutation: A269375. %Y A269377 Cf. also A252753, A269387. %K A269377 nonn,tabf %O A269377 0,2 %A A269377 _Antti Karttunen_, Mar 01 2016