OFFSET
1,2
LINKS
FORMULA
A078719(A(n,k)) = k.
EXAMPLE
Square array A(n,k) begins:
1, 5, 3, 17, 11, 7, 9, 25, 33, 43, ...
2, 10, 6, 34, 22, 14, 18, 49, 65, 86, ...
4, 20, 12, 35, 23, 15, 19, 50, 66, 87, ...
8, 21, 13, 68, 44, 28, 36, 51, 67, 89, ...
16, 40, 24, 69, 45, 29, 37, 98, 130, 172, ...
32, 42, 26, 70, 46, 30, 38, 99, 131, 173, ...
64, 80, 48, 75, 88, 56, 72, 100, 132, 174, ...
128, 84, 52, 136, 90, 58, 74, 101, 133, 177, ...
256, 85, 53, 138, 92, 60, 76, 102, 134, 178, ...
512, 160, 96, 140, 93, 61, 77, 196, 260, 179, ...
MAPLE
b:= proc(n) option remember; irem(n, 2, 'r')+
`if`(n=1, 0, b(`if`(n::odd, 3*n+1, r)))
end:
A:= proc() local h, p, q; p, q:= proc() [] end, 0;
proc(n, k)
if k=1 then return 2^(n-1) fi;
while nops(p(k))<n do q:= q+1;
h:= b(q);
p(h):= [p(h)[], q]
od; p(k)[n]
end
end():
seq(seq(A(n, 1+d-n), n=1..d), d=1..12);
MATHEMATICA
b[n_] := b[n] = Module[{q, r}, {q, r} = QuotientRemainder[n, 2]; r +
If[n == 1, 0, b[If[OddQ[n], 3*n + 1, q]]]];
A = Module[{h, p, q}, p[_] = {}; q = 0;
Function[{n, k}, If[k == 1, 2^(n - 1)];
While[Length[p[k]] < n, q = q + 1;
h = b[q];
p[h] = Append[p[h], q]];
p[k][[n]]]];
Table[Table[A[n, 1+d-n], {n, 1, d}], {d, 1, 12}] // Flatten (* Jean-François Alcover, Jun 02 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Alois P. Heinz, May 20 2022
STATUS
approved