OFFSET
1,2
COMMENTS
(See A233135.)
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
FORMULA
Define h(x) = x - 1 if x is odd and h(x) = x/2 if x is even, and define H(x,1) = h(x) and H(x,k) = H(H(x,k-1)). For each n > 1, the sequence (H(n,k)) decreases to 1 through two kinds of steps; write 1 when the step is x - 1 and write 2 when the step is x/2. A233137(n) is the concatenation of 1s and 2s, as in the Mathematica program.
MATHEMATICA
b[x_] := b[x] = If[OddQ[x], x - 1, x/2]; u[n_] := 2 - Mod[Drop[FixedPointList[b, n], -3], 2]; u[1] = {1}; t = Table[u[n], {n, 1, 30}]; Table[FromDigits[u[n]], {n, 1, 50}] (* A233137 *)
Flatten[t] (* A233138 *)
Table[FromDigits[Reverse[u[n]]], {n, 1, 30}] (* A233135 *)
Flatten[Table[Reverse[u[n]], {n, 1, 30}]] (* A233136 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, Dec 05 2013
STATUS
approved