OFFSET
1,2
COMMENTS
Density of regular language L over {1,2,3,4,5,6,7,8} (i.e., number of strings of length n in L) described by a regular expression with c = 8: Sum_{i=1..c} (Product_{j=1..i} (j(1+...+j)*), where "Sum" stands for union and "Product" for concatenation.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..1000
Joerg Arndt and N. J. A. Sloane, Counting Words that are in "Standard Order"
N. Moreira and R. Reis, On the density of languages representing finite set partitions, Technical Report DCC-2004-07, August 2004, DCC-FC& LIACC, Universidade do Porto.
N. Moreira and R. Reis, On the Density of Languages Representing Finite Set Partitions, Journal of Integer Sequences, Vol. 8 (2005), Article 05.2.8.
Index entries for linear recurrences with constant coefficients, signature (29,-343,2135,-7504,14756,-14832,5760).
FORMULA
For c = 8, a(n) = c^n/c! + Sum_{k=1..c-2} k^n/k! * Sum_{j=2..c-k} (-1)^j/j!, or = Sum_{k=1..c} g(k, c)*k^n, where g(1, 1) = 1, g(1, c) = g(1, c-1) + (-1)^(c-1)/(c-1)! for c > 1, and g(k, c) = g(k-1, c-1)/k for c > 1 and 2 <= k <= c.
G.f.: -x*(3641*x^6 - 6583*x^5 + 4566*x^4 - 1579*x^3 + 290*x^2 - 27*x + 1) / ((x-1)*(2*x-1)*(3*x-1)*(4*x-1)*(5*x-1)*(6*x-1)*(8*x-1)). [Colin Barker, Dec 05 2012]
a(n) = Sum_{k=0..8} Stirling2(n,k).
G.f.: Sum_{j=0..k} A248925(k,j)*x^j / Product_{j=1..k} (1 - j*x) with k = 8. - Robert A. Russell, Apr 25 2018
MATHEMATICA
CoefficientList[Series[-(3641 x^6 - 6583 x^5 + 4566 x^4 - 1579 x^3 + 290 x^2 - 27 x + 1) / ((x - 1) (2 x - 1) (3 x - 1) (4 x - 1) (5 x - 1) (6 x - 1) (8 x - 1)), {x, 0, 30}], x] (* Vincenzo Librandi, Jul 27 2017 *)
Table[Sum[StirlingS2[n, k], {k, 0, 8}], {n, 1, 30}] (* Robert A. Russell, Apr 25 2018 *)
LinearRecurrence[{29, -343, 2135, -7504, 14756, -14832, 5760}, {1, 2, 5, 15, 52, 203, 877}, 30] (* Harvey P. Dale, Aug 27 2019 *)
PROG
(Magma) [(1/40320)*8^n+(1/1440)*6^n+(1/360)*5^n+(1/64)*4^n +(11/180)*3^n+(53/288)*2^n+103/280: n in [1..30]]; // Vincenzo Librandi, Jul 27 2017
(PARI) a(n) = (1/40320)*8^n + (1/1440)*6^n + (1/360)*5^n + (1/64)*4^n + (11/180)*3^n + (53/288)*2^n + 103/280; \\ Altug Alkan, Apr 25 2018
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Nelma Moreira, Oct 10 2004
STATUS
approved