Define a function for $n$ $>$ $1$ which is $f(n)$ $=$ $k$, the maximum number of consecutive integers such that their product is $1$ $\pmod n$, and every integer $1 \leq x \leq k$, there exists $x$ consecutive integers such that their product is $1$ $\pmod n$.
For prime $n$, does $f(n)$ $=$ $n-2$?
Example (not a counterexample for the question above);
$n=11$, $f(11)$ $=$ $3$ because there are $1, 2, 3$ consecutive integers such that their product is $1$ $\pmod{11}$. But there are no $4$ consecutive integers such that their product is $1$ $\pmod {11}$. There are $9$ consecutive integers such that their product is $1$ $\pmod {11}$, but $f(11)$ $=$ $3$ due to the fact that the product of $4$ consecutive integers is never $1$ $\pmod {11}$.
$(1)$ $=$ $(1)$ $\pmod {11}$
$(3 \times 4)$, $(8 \times 7)$ $=$ $1$ $\pmod {11}$
$(5 \times 6 \times 7)$ $=$ $1$ $\pmod {11}$
Can anyone list some extraordinarily large values for $f(n)$, compared to most values of $f(n)$? The example is the largest I could come up with. Thanks for help, feedback, etc.
This question may be helpful.