The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 Hints (Greetings from The On-Line Encyclopedia of Integer Sequences!)
 A213283 Number of 4-length words w over n-ary alphabet such that 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. 2

%I

%S 0,1,9,36,118,315,711,1414,2556,4293,6805,10296,14994,21151,29043,

%T 38970,51256,66249,84321,105868,131310,161091,195679,235566,281268,

%U 333325,392301,458784,533386,616743,709515,812386,926064,1051281,1188793,1339380,1503846

%N Number of 4-length words w over n-ary alphabet such that 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 Alois P. Heinz, <a href="/A213283/b213283.txt">Table of n, a(n) for n = 0..1000</a>

%H <a href="/index/Rec#order_05">Index entries for linear recurrences with constant coefficients</a>, signature (5,-10,10,-5,1).

%F a(n) = n*(-9+17*n-8*n^2+2*n^3)/2.

%F G.f.: x*(1+4*x+x^2+18*x^3)/(1-x)^5.

%e a(0) = 0: no word of length 4 is possible for an empty alphabet.

%e a(1) = 1: aaaa for alphabet {a}.

%e a(2) = 9: aaaa, aaab, aaba, aabb, abaa, abab, baaa, baab, bbbb for alphabet {a,b}.

%e a(3) = 36: aaaa, aaab, aaac, aaba, aabb, aabc, aaca, aacb, aacc, abaa, abab, abac, abca, acaa, acab, acac, acba, baaa, baab, baac, baca, bbbb, bbbc, bbcb, bbcc, bcaa, bcbb, bcbc, caaa, caab, caac, caba, cbaa, cbbb, cbbc, cccc for alphabet {a,b,c}.

%p a:= n-> n*(-9+(17+(-8+2*n)*n)*n)/2:

%p seq(a(n), n=0..40);

%Y Row n=4 of A213276.

%K nonn,easy

%O 0,3

%A _Alois P. Heinz_, Jun 08 2012

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

Last modified May 28 17:37 EDT 2020. Contains 334684 sequences. (Running on oeis4.)