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 A293733 #16 May 30 2019 09:28:10 %S A293733 1,1,3,7,19,48,131,348,954,2607,7212,19995,55816,156246,439267, %T A293733 1238397,3502004,9927260,28208628,80322048,229161413,654966245, %U A293733 1875074366,5376298225,15437286706,44385247519,127776425727,368276055467,1062618076382,3069264747076 %N A293733 Number of multisets of nonempty words with a total of n letters over ternary alphabet such that within each prefix of a word every letter of the alphabet is at least as frequent as the subsequent alphabet letter. %H A293733 Alois P. Heinz, <a href="/A293733/b293733.txt">Table of n, a(n) for n = 0..1000</a> %F A293733 G.f.: Product_{j>=1} 1/(1-x^j)^A001006(j). %F A293733 a(n) ~ c * 3^n / n^(3/2), where c = 11.84175157992103588081767200532703865225243959779980786519467770732598276486... - _Vaclav Kotesovec_, May 30 2019 %p A293733 g:= proc(n) option remember; `if`(n<2, 1, %p A293733 g(n-1)+add(g(k)*g(n-k-2), k=0..n-2)) %p A293733 end: %p A293733 a:= proc(n) option remember; `if`(n=0, 1, add(add(g(d) %p A293733 *d, d=numtheory[divisors](j))*a(n-j), j=1..n)/n) %p A293733 end: %p A293733 seq(a(n), n=0..35); %t A293733 g[n_] := g[n] = If[n<2, 1, g[n-1] + Sum[g[k]*g[n-k-2], {k, 0, n-2}]]; %t A293733 a[n_] := a[n] = If[n==0, 1, Sum[Sum[g[d]*d, {d, Divisors[j]}]*a[n-j], {j, 1, n}]/n]; %t A293733 Table[a[n], {n, 0, 35}] (* _Jean-François Alcover_, May 30 2019, after _Alois P. Heinz_ *) %o A293733 (Python) %o A293733 from sympy.core.cache import cacheit %o A293733 from sympy import divisors %o A293733 @cacheit %o A293733 def g(n): return 1 if n<2 else g(n - 1) + sum([g(k)*g(n - k - 2) for k in range(n - 1)]) %o A293733 @cacheit %o A293733 def a(n): return 1 if n==0 else sum([sum([g(d)*d for d in divisors(j)])*a(n - j) for j in range(1, n + 1)])//n %o A293733 print(map(a, range(36))) # _Indranil Ghosh_, Oct 15 2017 %Y A293733 Column k=3 of A293108. %Y A293733 Cf. A001006. %K A293733 nonn %O A293733 0,3 %A A293733 _Alois P. Heinz_, Oct 15 2017