When listing the integers from $1$ to a number $x \in \mathbb{N},$ the number of times a zero is written is $$\sum^{\lfloor\log_{10}x\rfloor}_{k = 1} \left \lfloor{\frac{x}{10^k}}\right \rfloor.$$ Extending this to $x$ in other bases, it follows that the above statement can be generalized to any $x$ in a base $b$: $$\sum^{\lfloor\log_{b}x\rfloor}_{k = 1} \left \lfloor{\frac{x}{b^k}}\right \rfloor.$$ However, this does not seem to be an accurate statement. Could someone tell me where I went wrong with this?
2026-04-04 14:17:31.1775312251
Generalization of number of zeros listed from $1$ to a number
27 Views Asked by user389427 https://math.techqa.club/user/user389427/detail At
1
Fix a base $b \ge 2$, and let $x=b^2+1$.
For $1 \le n \le x$, we get
Thus, for $x=b^2+1$, the number of zeros is$\\[10pt]$ $$(b-1) + 2 + 1 = b+2$$ but $$ \sum^{\lfloor\log_{b}x\rfloor}_{k = 1} \left \lfloor{\frac{x}{b^k}}\right \rfloor = \left\lfloor{\frac{b^2+1}{b}}\right\rfloor+\left\lfloor{\frac{b^2+1}{b^2}}\right\rfloor=b+1$$