Let $p-$ be a prime number and the representation of the number $n$ in the $p$-ary system has the form: $n=a_{k} p^{k}+a_{k-1} p^{k-1}+\ldots+a_{1} p^{1}+$ $a_{0}$.

Find the formula expressing the exponent $\alpha_{p}$, with which this number $p$ enters the canonical decomposition of $n!$, in terms of $n, p$, and the coefficients $a_{k}$.
According to the Legendre's formula (see problem $\underline{60553}$ )

$\alpha_{p}=\left(a_{k} p^{k-1}+\ldots+a_{1}\right)+\left(a_{k} p^{k-2}+\ldots+a_{2}\right)+\ldots+a_{k}=a_{k}\left(p^{k-1}+\ldots+p+1\right)+\ldots+a_{1}=$ $\frac{a_{k}\left(p^{k}-1\right)+\ldots+a_{0}\left(p^{0}-1\right)}{p-1}=\frac{n-a_{k}-\ldots-a_{0}}{p-1}$.