login
A345445
a(n) = n^n - (n+1)!/2.
0
0, 1, 15, 196, 2765, 44136, 803383, 16595776, 385606089, 9980041600, 285072169811, 8912986937856, 302831517446653, 11111352988374016, 437883428985915375, 18446566229995503616, 827237060699483900177, 39346347252746333159424, 1978418439209309500803979, 104857574454528914145280000
OFFSET
1,3
COMMENTS
This sequence appears as a class of nonsortable words of length n for several unadapted sorting algorithms. For instance this one:
- scan all values not at their index position
- rotate left 1 step all of them as a cycle
- repeat.
This is linked to the fact that one can encode the alternating permutations of length n+1 as words of length n.
MATHEMATICA
Table[n^n - (n + 1)!/2, {n, 1, 20}]
CROSSREFS
Cf. A185391 (Complement to n^n of a class of words).
Sequence in context: A125472 A098300 A185899 * A152587 A060337 A180789
KEYWORD
nonn,easy
AUTHOR
Olivier Gérard, Jun 19 2021
STATUS
approved