OFFSET
1,2
COMMENTS
A fractal sequence, generated by the rule a(n) is a new maximum when a(n-1) is odd and a repetition of an earlier value when a(n-1) is even.
From Flávio V. Fernandes, Mar 13 2025: (Start)
1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9
. 1 . . . 2 . . . 3 . . . 4 . . .
. . . 1 . . . . . . . 2 . . . . .
. . . . . . . 1 . . . . . . . . .
. . . . . . . . . . . . . . . 1 .
1 . 2 . 4 . 5 . 8 . 9 .11 .12 .16
. 3 . . . 6 . . .10 . . .13 . . .
. . . 7 . . . . . . .14 . . . . .
. . . . . . .15 . . . . . . . . .
. . . . . . . . . . . . . . .31 . - see formula. (End)
LINKS
Alois P. Heinz, Rows n = 1..10000, flattened
FORMULA
a(1) = 1, for n > 1, if a(n-1) is even, a(n) = a(n-1)/2, otherwise a(n) = (max_{k<n} a(k)) + 1.
Ordinal transform of A082850.
EXAMPLE
Triangle starts
1;
2, 1;
3;
4, 2, 1;
5;
6, 3;
7;
8, 4, 2, 1;
9;
10, 5;
11;
12, 6, 3;
13;
MAPLE
T:= proc(n) local m, l; m:=n; l:= m;
while irem(m, 2, 'm')=0 do l:=l, m od: l
end:
seq(T(n), n=1..40); # Alois P. Heinz, Oct 09 2015
MATHEMATICA
Flatten[Function[n, NestWhile[Append[#, Last[#]/2] &, {n}, EvenQ[Last[#]] &]][#] & /@ Range[20]] (* Birkas Gyorgy, Apr 13 2011 *)
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Franklin T. Adams-Watters, Oct 13 2006
STATUS
approved
