The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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. 0

%I #14 Nov 17 2014 21:30:15

%S 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 50,77,44,71,53,80,121,202,148,229,130,211,157,238,124,205,151,232,

%U 133,214,160,241,122,203,149,230,131,212,158,239,125,206,152,233,134,215,161,242,364

%N 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 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 Adrian Rusu, <a href="http://cs.brown.edu/~rt/gdhandbook/chapters/trees.pdf">Tree Drawing Algorithms</a>, Rowan University.

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CompleteBinaryTree.html">Complete Binary Tree</a>.

%e 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 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 Cf. A032924.

%K nonn

%O 1,3

%A _Frank M Jackson_, Nov 12 2014

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 12:24 EDT 2024. Contains 372540 sequences. (Running on oeis4.)