Let S={1,2,…,2021}, and let F denote the set of functions f:S→S. For a function f∈F, let
Tf={f2021(s):s∈S},
where f2021(s) denotes f(f(⋯(f(s))⋯)) with 2021 copies of f. Compute the remainder when
f∈F∑∣Tf∣
is divided by the prime 2017, where the sum is over all functions f in F.