OFFSET
1,2
COMMENTS
a(n) is the number of length n sequences of [n] that start with their maximum value.
By symmetry, counts many other simple classes of endofunctions.
LINKS
Seiichi Manyama, Table of n, a(n) for n = 1..387
FORMULA
a(n) = Sum_{m=1..n} m^(n-1), n >= 1.
EXAMPLE
The 3 sequences for n=2 are 11, 21, 22.
The 14 = 3^0 + 3^1 + 3^2 sequences starting with their maximum value for n=3 are 111, 211, 212, 221, 222, 311, 312, 313, 321, 322, 323, 331, 332, 333.
MAPLE
a:=n->sum((n-j+1)^n, j=0..n): seq(a(n), n=0..17); # Zerinvary Lajos, Jun 05 2008
MATHEMATICA
f[n_]:=Module[{s=0}, Do[s+=a^n, {a, 0, n+1}]; s]; Table[f[n], {n, 20}] (* Vladimir Joseph Stephan Orlovsky, Feb 18 2010 *)
Table[Sum[m^(n-1), {m, n}], {n, 20}] (* Harvey P. Dale, Jan 26 2016 *)
PROG
(PARI) vector(20, n, sum(m=1, n, m^(n-1))) \\ Michel Marcus, Jan 14 2015
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Wolfdieter Lang, Oct 02 2002
EXTENSIONS
Definition changed and example added by Olivier Gérard, Jan 28 2023
STATUS
approved