OFFSET
0,2
COMMENTS
This sequence appears in the calculation of the expectation of the number of runs of an n-faced die, stopping when a face appears for the second time.
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..350
FORMULA
a(n) = Sum_{k=0..n} k! * n^(n-k). - G. C. Greubel, Jan 12 2022
MAPLE
A112541 := proc(n)
add((n-k)!*n^k, k=0..n) ;
end proc:
seq(A112541(n), n=0..13) ; # R. J. Mathar, Dec 16 2015
MATHEMATICA
f[n_]:= Sum[(n-k)!n^k, {k, 0, n}]; Array[f, 17] (* Robert G. Wilson v, , Dec 22 2005 *)
PROG
(Magma) [(&+[Factorial(k)*n^(n-k): k in [0..n]]): n in [0..20]]; // G. C. Greubel, Jan 12 2022
(Sage) [sum(factorial(k)*n^(n-k) for k in (0..n)) for n in (0..20)] # G. C. Greubel, Jan 12 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Roger Cuculière, Dec 17 2005
EXTENSIONS
Corrected and extended by Robert G. Wilson v, Dec 22 2005
STATUS
approved