A344792 a(n) is half the n-th term of a truncated sesquinary (base 3/2) tree.
1, 4, 2, 6, 10, 3, 13, 9, 22, 15, 121, 7, 5, 67, 20, 31, 14, 33, 76, 34, 23, 409, 182, 16, 11, 40, 8, 151, 101, 30, 46, 70, 47, 21, 49, 112, 50, 114, 172, 51, 175, 52, 35, 1381, 614, 273, 616, 24, 37, 25, 17, 60, 91, 12, 19, 340, 227, 769, 152, 45, 103, 69, 157
Offset: 1
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
- Index entries for sequences that are permutations of the natural numbers
Programs
-
Java
See Links.
-
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 *)
-
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
Comments