Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #8 Jan 28 2023 22:07:43
%S 1,1,2,4,9,21,46,108,223,487,1028,2060,4327,8591,16818,33562,64441,
%T 122983,232378,443446,816371,1503517,2775372,5052186,9116047,16231929,
%U 29182198,51503788,91032821,158301653,275776810,479642780,824964483,1414293391,2403093256,4095230980
%N Number of length n word structures with all distinct runs using at most 3 symbols.
%C Permuting the symbols will not change the structure.
%H Andrew Howroyd, <a href="/A351644/b351644.txt">Table of n, a(n) for n = 0..1000</a>
%F a(n) = A351018(n) + A351643(n).
%F a(n) = Sum_{k=0..3} A351641(n,k).
%e The a(1) = 1 word is 1.
%e The a(2) = 2 words are 11, 12.
%e The a(3) = 4 words are 111, 112, 122, 123.
%e The a(4) = 9 words are 1111, 1112, 1121, 1122, 1211, 1222, 1123, 1223, 1233.
%o (PARI) \\ See A351641 for R, S.
%o seq(n)={my(q=S(n), c=3); concat([1], sum(k=1, c, R(q^k-1)*sum(r=k, c, binomial(r, k)*(-1)^(r-k)/r!) )); }
%Y Cf. A351018, A351641, A351643.
%K nonn
%O 0,3
%A _Andrew Howroyd_, Feb 16 2022