login
A240617
Number of n-length words w over an n-ary alphabet such that w is empty or a prefix z concatenated with letter a_i and i=1 or 0 < #(z,a_{i-1}) >= #(z,a_i), where #(z,a_i) counts the occurrences of the i-th letter in z.
1
1, 1, 2, 5, 14, 46, 165, 651, 2771, 12638, 61398, 315563, 1710027, 9725543, 57886132, 359476571, 2323518017, 15597303757, 108522502933, 781283103284, 5810573402452, 44579551962460, 352360829928066, 2865876353091752, 23958937424819348, 205673285003637629
OFFSET
0,3
EXAMPLE
a(0) = 1: the empty word.
a(1) = 1: 1.
a(2) = 2: 11, 12.
a(3) = 5: 111, 112, 121, 122, 123.
a(4) = 14: 1111, 1112, 1121, 1122, 1123, 1211, 1212, 1213, 1221, 1223, 1231, 1232, 1233, 1234.
a(5) = 46: 11111, 11112, 11121, ..., 12343, 12344, 12345.
a(6) = 165: 111111, 111112, 111121, ..., 123454, 123455, 123456.
CROSSREFS
Main diagonal of A240608.
Sequence in context: A240614 A240615 A240616 * A001680 A275424 A328429
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Apr 09 2014
STATUS
approved