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 A213873 #18 Oct 31 2018 22:36:08 %S A213873 1,6,15,106,1075,13326,188196,2914395,48349015,846167608,15456538890, %T A213873 292407484590,5695907466120,113735416237808,2319861446805120, %U A213873 48199341935153655,1017747539683821855,21799192392184931700,472889100118180757550,10375788309377599231200 %N A213873 Number of words w where each letter of the ternary alphabet occurs n times and for every prefix z of w we have #(z,a_i) = 0 or #(z,a_i) >= #(z,a_j) for all j>i and #(z,a_i) counts the occurrences of the i-th letter in z. %H A213873 Alois P. Heinz, <a href="/A213873/b213873.txt">Table of n, a(n) for n = 0..706</a> %F A213873 a(n) ~ 797*sqrt(3)*27^(n-1)/(16*Pi*n^4). - _Vaclav Kotesovec_, Aug 13 2013 %F A213873 For n > 1, a(n) = 3*(-4 + 108*n - 397*n^2 - 72*n^3 + 797*n^4) * (3*n-4)! / (2*(2*n-1)*(2*n+1) * (n-2)! * (n+1)! * (n+2)!). - _Vaclav Kotesovec_, Sep 02 2014 %e A213873 a(0) = 1: the empty word. %e A213873 a(1) = 6: abc, acb, bac, bca, cab, cba, (all permutations of 3 letters). %e A213873 a(2) = 15: aabbcc, aabcbc, aacbbc, ababcc, abacbc, abcabc, acabbc, acbabc, baabcc, baacbc, bacabc, bcaabc, caabbc, cababc, cbaabc. %p A213873 a:= proc(n) option remember; `if`(n<2, [1, 6][n+1], (6*n-9) *(3*n-4) %p A213873 *(3*n-5) *(797*n^4-72*n^3-397*n^2+108*n-4) *a(n-1) / ((n+1) %p A213873 *(n+2) *(2*n+1) *(797*n^4-3260*n^3+4601*n^2-2502*n+360))) %p A213873 end: %p A213873 seq(a(n), n=0..20); %t A213873 Flatten[{1, 6, Table[3*(-4 + 108*n - 397*n^2 - 72*n^3 + 797*n^4) * (3*n-4)! / (2*(2*n-1)*(2*n+1) * (n-2)! * (n+1)! * (n+2)!), {n, 2, 20}]}] (* _Vaclav Kotesovec_, Sep 02 2014 *) %Y A213873 Column k=3 of A213275. %K A213873 nonn %O A213873 0,2 %A A213873 _Alois P. Heinz_, Jun 23 2012