OFFSET
1,2
COMMENTS
a(n) is the number of monotonic runs over all length n words on an alphabet of n letters. - Geoffrey Critzer, Jun 25 2013
LINKS
Harry J. Smith, Table of n, a(n) for n = 1..100
FORMULA
E.g.f.: (-1/2)*LambertW(-x)*(1 + 1/(1 + LambertW(-x))^3). - G. C. Greubel, May 04 2022
EXAMPLE
a(3) = {3^4 +3^2}/2 = 45.
MATHEMATICA
Table[(n^(n-1)+n^(n+1))/2, {n, 1, 20}] (* Geoffrey Critzer, Jun 25 2013 *)
PROG
(PARI) { for (n=1, 30, write("b062023.txt", n, " ", (n^(n+1) + n^(n-1))/2) ) } \\ Harry J. Smith, Jul 29 2009
(SageMath) [(n^(n+1) + n^(n-1))/2 for n in (1..20)] # G. C. Greubel, May 04 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Jun 02 2001
EXTENSIONS
More terms from Larry Reeves (larryr(AT)acm.org), Jun 06 2001
STATUS
approved