This is based on an [older question](https://mathoverflow.net/questions/389343/expectation-of-period-length-of-functions-f-1-ldots-n-to-1-ldots-n).


For $n\in\mathbb{N}$, let $[n]:= \{1,\ldots,n\}$. Let $\text{Fun}(n)$ denote the set of all functions $f:[n]\to[n]$. To $f\in\text{Fun}(n)$ and ''starting value'' $s\in [n]$ we associate a sequence $\text{seq}(f,s))$ defined recursively by


* $\text{seq}(f,s)\_1 = f(s)$, and
* $\text{seq}(f,s)\_{k+1} = f(\text{seq}(f,s)\_k)$ for all $k\in\mathbb{N}$.


Eventually $\text{seq}(f,s)$ will be periodic, and with $\text{per}(f,s)$ we denote the length of the period of $\text{seq}(f,s)$. By $\text{maxper}(f)$ we denote the *maximum period for any starting value*, that is $$\text{maxper}(f) = \max\{\text{per}(f, s): s\in[n]\}.$$ By $E\_n$ we denote the *expected value* of $\text{maxper}(f)$ for any $f\in\text{Fun}(n)$. Explicitly, we have $$E\_n = \frac{1}{n^n}\sum\_{f\in\text{Fun}(n)}\text{maxper}(f).$$


**Questions.** What is the value of $\lim\sup\_{n\to\infty} E\_n/n$?



Expectation of maximum of all period lengths of functions $f:\{1,\ldots,n\}\to\{1,\ldots,n\}$
Purdom and Williams, Cycle length in a random function, Trans. Amer. Math. Soc., 1968: available [here](https://www.researchgate.net/profile/Paul-Purdom/publication/238873092_Cycle_Length_in_a_Random_Function/links/0deec53ad888027a84000000/Cycle-Length-in-a-Random-Function.pdf?origin=publication_detail).


$$E\_n=G\_{1,1}\sqrt{\pi n/2}+(1/6)+o(1)\sim 0.78248 \sqrt{n}.
$$
See also A244067 [here](http://oeis.org/A244067/internal) on OEIS.


