Show No. of trailing zeros in base $p$ representation = power of prime $p$. .

99 Views Asked by At

Let $N$ be an integer $> 1$, and $p$ a prime, then need show:

No. of trailing zeros in base $p$ representation = power of prime $p$ in prime factorization.

Say, $N= 31500 = 2002000_5$, and $31500= 2^2.3^2.5^3.7$, i.e. three trailing zeros in base-$5$.

And, $31500 = 160560_7$, and has one trailing zero only.

My attempt is very basic, also not sure if it satisfies the necessary and sufficient conditions needed for a proof.

The base-$p$ representation of a number, say $d_m.d_{m-1}...d_2.d_1.d_0$ where the $d_i$ are the digits, is a shorthand for

$N = d_m \cdot p^m + d_{m-1} \cdot p^{m-1} + \ldots + d_2 \cdot p^2 + d_1 \cdot p + d_0$

If the last $n$ digits, $d_0$ through $d_{n-1}$, are zero, this becomes

$N = d_m \cdot p^m + d_{m-1} \cdot p^{m-1} + \ldots + d_n \cdot p^n = p^n(d_m \cdot p^{m-n} + d_{m-1} \cdot p^{m-n-1} + \ldots + d_n)$

so that $p^n | N$.

So, will it work to show that $p^{n+1}$ does not divide $N$, so that $n$ is the greatest power of $p$ that divides $N$?

In other words, will it suffice:

If $d_n \ne 0$, then $p$ does not divide $d_m \cdot p^{m-n} + d_{m-1} \cdot p^{m-n-1} + \ldots + d_n$.

1

There are 1 best solutions below

10
On BEST ANSWER

We have $0 \le d_i < p,$ if $d_n \ne 0$.

Hence, $$\sum_{i=n}^m d_ip^{i-n} \equiv \left(\sum_{i=n+1}^m d_ip^{i-n} \right)+ d_np^{n-n} \equiv d_n \not \equiv 0 \pmod{p}$$

Hence the number of trailing $0$'s is equal to the power of prime $p$.