While reading here I got that formula to find digital roots of $n$. My problem is how do we get that simple formula?
My tries:
Let number be written in base $10$ and equals $P(10)=n$ where $P(x)=\displaystyle\sum_{k=0}^{m}a_{k}x^{k}$
$$10\equiv 1 \mod 9$$
Now,
$$P(10)\equiv P(1) \mod 9$$
$$n\equiv dr(n)\mod 9$$
$$dr(n)=n-9\cdot k$$
Now how to prove $k=\bigg\lfloor{\dfrac{n-1}{9}}\bigg\rfloor$?
I think you must mean "how to prove $k=\lfloor\frac{n-1}{9}\rfloor$?"
You know that $k$ is an integer, but if it is less than $\lfloor\frac{n-1}9\rfloor$ then $n-9k\geq 10$, and if it is greater then $n-9k\leq 0$. Because the digital root has to be between $1$ and $9$, that is the only value of $k$ which can work.
To deduce this without knowing the right formula to start with, we might do the following.
$dr(n)\geq 1$ so $k=\frac{n-dr(n)}{9}\leq\frac{n-1}{9}$. Also $dr(n)\leq 9$ and so $k\geq \frac{n-9}9$, which means $k>\frac{n-1}9-1$. Thus $k$ is an integer with $\frac{n-1}9\geq k>\frac{n-1}9-1$, so it must be $\lfloor\frac{n-1}9\rfloor$.