OFFSET
1,2
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..250
FORMULA
a(n) = 2*(n^n) - A001923(n), for n > 0. - Kritsada Moomuang, Feb 11 2019
EXAMPLE
1^1 - 0 = 1,
2^2 - 1 = 3,
3^3 - 2^2 - 1 = 22,
4^4 - 3^3 - 2^2 - 1 = 224, ...
MATHEMATICA
f[n_]:=n^n; lst={}; Do[a=f[n]; Do[a-=f[m], {m, n-1, 1, -1}]; AppendTo[lst, a], {n, 30}]; lst
Table[n^n -Sum[(n-k)^(n-k), {k, 1, n-1}], {n, 1, 20}] (* G. C. Greubel, Feb 11 2019 *)
PROG
(PARI) {a(n) = n^n - sum(k=1, n-1, (n-k)^(n-k))}; \\ G. C. Greubel, Feb 11 2019
(Magma) [n^n - (&+[(n-k)^(n-k): k in [1..n-1]]): n in [1..20]]; // G. C. Greubel, Feb 11 2019
(Sage) [n^n - sum((n-k)^(n-k) for k in (1..n-1)) for n in (1..20)] # G. C. Greubel, Feb 11 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Vladimir Joseph Stephan Orlovsky, Feb 10 2010
STATUS
approved