OFFSET
0,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..380
FORMULA
a(n) = n^n - (1/2) Sum_{k>=0} k^n/2^k.
E.g.f.: 1/(1+LambertW(-x)) - 1/(2-exp(x)). - Alois P. Heinz, Aug 03 2014
EXAMPLE
a(3) = 3^3 - (1/2) Sum_{k>=0} k^3/2^k = 27 - 1/2 * 26 = 27 - 13 = 14.
MAPLE
a:= n-> n^n -sum(k^n/2^k, k=0..infinity)/2:
seq(a(n), n=0..25); # Alois P. Heinz, Jul 29 2014
# second Maple program:
b:= proc(n) b(n):= `if`(n=0, 1, add(b(n-j)/j!, j=1..n)) end:
a:= n-> n^n- b(n)*n!:
seq(a(n), n=0..25); # Alois P. Heinz, Jul 29 2014
MATHEMATICA
a[n_] := If[n==0, 0, n^n - HurwitzLerchPhi[1/2, -n, 0]/2];
a /@ Range[0, 25] (* Jean-François Alcover, Nov 10 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ramesh L. Srigiriraju (rsrigir(AT)vt.edu), Oct 16 2007
EXTENSIONS
More terms and a(14)-a(17) corrected by Alois P. Heinz, Jul 29 2014
STATUS
approved