cp's OEIS Frontend

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.

A293742 Number of sets 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.

This page as a plain text file.
%I A293742 #17 May 04 2020 11:29:13
%S A293742 1,1,2,6,14,39,104,284,775,2145,5941,16563,46329,130100,366432,
%T A293742 1035191,2931797,8323290,23680142,67505721,192791938,551537506,
%U A293742 1580315319,4534715008,13030197881,37489497472,107991978290,311433926717,899093131819,2598257241179
%N A293742 Number of sets 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 A293742 Alois P. Heinz, <a href="/A293742/b293742.txt">Table of n, a(n) for n = 0..1000</a>
%F A293742 G.f.: Product_{j>=1} (1+x^j)^A001006(j).
%p A293742 g:= proc(n) option remember; `if`(n<2, 1,
%p A293742       g(n-1)+add(g(k)*g(n-k-2), k=0..n-2))
%p A293742     end:
%p A293742 b:= proc(n, i) option remember; `if`(n=0, 1, `if`(i<1, 0,
%p A293742       add(b(n-i*j, i-1)*binomial(g(i), j), j=0..n/i)))
%p A293742     end:
%p A293742 a:= n-> b(n$2):
%p A293742 seq(a(n), n=0..35);
%t A293742 With[{n = 29}, CoefficientList[Series[Product[(1 + x^j)^Hypergeometric2F1[(1 - j)/2, -j/2, 2, 4], {j, n}], {x, 0, n}], x]] (* _Michael De Vlieger_, Oct 15 2017, after _Peter Luschny_ at A001006 *)
%o A293742 (Python)
%o A293742 from sympy.core.cache import cacheit
%o A293742 from sympy import binomial
%o A293742 @cacheit
%o A293742 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 A293742 @cacheit
%o A293742 def b(n, i): return 1 if n==0 else 0 if i<1 else sum(b(n - i*j, i - 1)*binomial(g(i), j) for j in range(n//i + 1))
%o A293742 def a(n): return b(n, n)
%o A293742 print([a(n) for n in range(36)]) # _Indranil Ghosh_, Oct 15 2017
%Y A293742 Column k=3 of A293112.
%Y A293742 Cf. A001006.
%K A293742 nonn
%O A293742 0,3
%A A293742 _Alois P. Heinz_, Oct 15 2017