OFFSET
1,2
COMMENTS
The tree is created by planting a tree with alternating branching and nonbranching nodes (as described in A005428). The nodes are then labeled in order -- 1,2,3,4,... All odd nodes are removed, leaving an infinite binary tree of every even number. Finally, each node is divided by two. The first four rows of the resultant tree are as follows:
1
4 2
6 10 3 13
9 22 15 121 7 5 67 20
...
The first number of the n-th row, a(2^(n-1)), is A081614(n). The last number of the n-th row is A182459(n). The lowest number of the n-th row is A061419(n). It appears that when n is even, A189706(a(n)+1) = 0, and when n is odd A189706(a(n)+1) = 1. This is true for at least the first n = 1 through 40000.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..10000
John-Vincent Saddic, Java code to produce the first n lines of the tree
John-Vincent Saddic, Diagram to construct the tree
John-Vincent Saddic, Log/log scatterplot
MAPLE
a:= proc(n) option remember;
a(iquo(n, 2))*3 + irem(n, 2);
while %::odd do ceil(% * 3/2) od; %/2
end: a(1):=1:
seq(a(n), n=1..63); # Alois P. Heinz, May 29 2021
MATHEMATICA
a[n_] := a[n] = Module[{t}, t = a[Quotient[n, 2]]*3 + Mod[n, 2];
While[OddQ[t], t = Ceiling[t * 3/2] ]; t/2]; a[1] = 1;
Table[a[n], {n, 1, 63}] (* Jean-François Alcover, Apr 14 2022, after Alois P. Heinz *)
PROG
(Java) See Links.
(PARI) a(n) = my(t=1); forstep(i=logint(n, 2)-1, 0, -1, t=3*t+1+bittest(n, i); my(k=valuation(t, 2)); t=(t*3^k)>>(k+1)); t; \\ Kevin Ryde, May 29 2021
CROSSREFS
KEYWORD
nonn,look
AUTHOR
John-Vincent Saddic, May 28 2021
STATUS
approved