This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A122005 #10 Mar 04 2015 21:31:49 %S A122005 1,2,3,1,4,5,6,2,7,8,9,3,1,10,11,12,4,13,14,15,5,16,17,18,6,2,19,20, %T A122005 21,7,22,23,24,8,25,26,27,9,3,1,28,29,30,10,31,32,33,11,34,35,36,12,4, %U A122005 37,38,39,13,40,41,42,14,43,44,45,15,5,46,47,48,12,4,49,50,51,17 %N A122005 Triangle read by rows: n-th row starts with n and continues with 1/3 the previous value as long as that is an integer. %C A122005 A fractal sequence, which is to 3 as A123390 is to 2. Row lengths are A051064 3^a(n) exactly divides 3*n. Or, 3-adic valuation of 3*n. %F A122005 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. %e A122005 Triangle starts: %e A122005 1; %e A122005 2; %e A122005 3, 1; %e A122005 4; %e A122005 5; %e A122005 6, 2; %e A122005 7; %e A122005 8; %e A122005 9, 3, 1; %e A122005 10; %e A122005 11; %e A122005 12, 4; %e A122005 13; %e A122005 14; %e A122005 15, 5; %e A122005 16; %t A122005 Flatten[Function[n,NestWhile[Append[#, Last[#]/3] &, {n}, Last[#]/3 == Floor[Last[#]/3] &]][#] & /@ Range[50]] (* _Birkas Gyorgy_, Apr 14 2011 *) %Y A122005 Cf. A051064, A123390. %K A122005 easy,nonn,tabf %O A122005 1,2 %A A122005 _Jonathan Vos Post_, Oct 14 2006