I am looking for notations and ways to formalize applications/functions involving permutations.
Let a sequence of integers $1$, $2$, ... $n$. How to formalize, mathematically, a permutation that consists to randomly permute the $n-1$ first integers, letting unchanged the last one, $n$.
Thank you.
This (PDF) does an excellent job of going over the various notations for permutations.
In this case, you've already formalised it. However, what you're doing is choosing a random element of $S_{n-1}$, taking the (first) natural inclusion of $S_{n-1}$ in $S_n$, and taking the image of your random element under that inclusion (equivalently, you're choosing a random element of the stabiliser $\mathrm{Stab}_{S_n}(n)$ of $n$ inside $S_n$).