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 A244591 #15 Feb 16 2025 08:33:23 %S A244591 0,1,2,4,7,5,8,13,22,16,25,14,23,17,26,40,67,49,76,43,70,52,79,41,68, %T A244591 50,77,44,71,53,80,121,202,148,229,130,211,157,238,124,205,151,232, %U A244591 133,214,160,241,122,203,149,230,131,212,158,239,125,206,152,233,134,215,161,242,364 %N A244591 Zero followed by the terms of A032924 arranged to give the unique path to the n-th node of a complete, rooted and ordered binary tree. %C A244591 There is no path to the root node so first node path is 0. All other paths are represented by the terms of A032924 that are base 3 numbers containing no zeros. Starting at the lowest order digit base 3, if this is 1 then the path from the root node to a lower level node is to the left, otherwise it is to the right. Each successive digit order defines the next path to be taken until the highest digit order is reached and the specified node found. %H A244591 Adrian Rusu, <a href="http://cs.brown.edu/~rt/gdhandbook/chapters/trees.pdf">Tree Drawing Algorithms</a>, Rowan University. %H A244591 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/CompleteBinaryTree.html">Complete Binary Tree</a>. %e A244591 a(11)=25, so the path to node 11 is given by 25 which when represented as a base 3 number gives 221. Hence the path to the 11th node from the root node is Left, Right, Right. %t A244591 nest[{m_, p_}] := (If[EvenQ[m], ind=1, ind=2]; {Floor[m/2], 3p+ind}); Table[NestWhile[nest, {n, 0}, #[[1]]!=1 &][[2]], {n, 1, 100}] %Y A244591 Cf. A032924. %K A244591 nonn %O A244591 1,3 %A A244591 _Frank M Jackson_, Nov 12 2014