OFFSET
1,2
COMMENTS
FORMULA
a(1) = 1, for n > 1, if 3|a(n-1) then a(n) = a(n-1)/3, otherwise a(n) = (max_{k<n} a(k)) + 1.
EXAMPLE
Triangle starts:
1;
2;
3, 1;
4;
5;
6, 2;
7;
8;
9, 3, 1;
10;
11;
12, 4;
13;
14;
15, 5;
16;
MATHEMATICA
Flatten[Function[n, NestWhile[Append[#, Last[#]/3] &, {n}, Last[#]/3 == Floor[Last[#]/3] &]][#] & /@ Range[50]] (* Birkas Gyorgy, Apr 14 2011 *)
CROSSREFS
KEYWORD
easy,nonn,tabf
AUTHOR
Jonathan Vos Post, Oct 14 2006
STATUS
approved