login
A337150
Nonnegative integers in the order in which they appear first in A006577.
2
0, 1, 7, 2, 5, 8, 16, 3, 19, 6, 14, 9, 17, 4, 12, 20, 15, 10, 23, 111, 18, 106, 26, 13, 21, 34, 109, 29, 104, 11, 24, 112, 32, 107, 27, 102, 22, 115, 35, 110, 30, 92, 105, 118, 25, 87, 38, 100, 113, 69, 33, 95, 46, 108, 121, 28, 41, 90, 103, 116, 36, 85, 54
OFFSET
1,3
COMMENTS
This is A006577 with duplicates removed.
This is a permutation of the nonnegative integers.
FORMULA
a(n) = A006577(A337149(n)).
a(n) = A006577(n) for 1 <= n <= 12.
MAPLE
collatz:= proc(n) option remember; `if`(n=1, 0,
1 + collatz(`if`(n::even, n/2, 3*n+1)))
end:
b:= proc() 0 end:
g:= proc(n) option remember; local t;
`if`(n=1, 0, g(n-1));
t:= collatz(n); b(t):= b(t)+1
end:
h:= proc(n) option remember; local k; for k
from 1+h(n-1) while g(k)>1 do od; k
end: h(0):=0:
a:= n-> collatz(h(n)):
seq(a(n), n=1..100);
MATHEMATICA
collatz[n_] := collatz[n] = If[n==1, 0,
1 + collatz[If[EvenQ[n], n/2, 3n+1]]];
b[_] = 0;
g[n_] := g[n] = Module[{t}, If[n==1, 0, g[n-1]];
t = collatz[n]; b[t] = b[t]+1];
h[n_] := h[n] = Module[{k}, For[k = 1+h[n-1],
g[k]>1, k++]; k]; h[0] = 0;
a[n_] := a[n] = collatz[h[n]];
Array[a, 100] (* Jean-François Alcover, Jan 30 2021, after Alois P. Heinz *)
CROSSREFS
Sequence in context: A340420 A127885 A006577 * A280234 A368383 A073652
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, Jan 27 2021
STATUS
approved