\documentclass[12pt,reqno]{article} \usepackage[usenames]{color} \usepackage{amssymb} \usepackage{graphicx} \usepackage{amscd} \usepackage[colorlinks=true, linkcolor=webgreen, filecolor=webbrown, citecolor=webgreen]{hyperref} \definecolor{webgreen}{rgb}{0,.5,0} \definecolor{webbrown}{rgb}{.6,0,0} \usepackage{color} \usepackage{fullpage} \usepackage{float} \usepackage{psfig} \usepackage{graphics,amsmath,amssymb} \usepackage{amsthm} \usepackage{amsfonts} \usepackage{latexsym} \usepackage{epsf} \setlength{\textwidth}{6.5in} \setlength{\oddsidemargin}{.1in} \setlength{\evensidemargin}{.1in} \setlength{\topmargin}{-.5in} \setlength{\textheight}{8.9in} \newcommand{\seqnum}[1]{\href{http://oeis.org/#1}{\underline{#1}}} \begin{document} \begin{center} \epsfxsize=4in \leavevmode\epsffile{logo129.eps} \end{center} \theoremstyle{plain} \newtheorem{theorem}{Theorem} \newtheorem{corollary}[theorem]{Corollary} \newtheorem{lemma}[theorem]{Lemma} \newtheorem{proposition}[theorem]{Proposition} \theoremstyle{definition} \newtheorem{definition}[theorem]{Definition} \newtheorem{example}[theorem]{Example} \newtheorem{conjecture}[theorem]{Conjecture} \theoremstyle{remark} \newtheorem{remark}[theorem]{Remark} \begin{center} \vskip 1cm{\LARGE\bf On the Base-$b$ Expansion of the Number of Trailing Zeros of $b^k!$ } \vskip 1cm \large Antonio M. Oller-Marc\'{e}n\\ Departamento de Matem\'{a}ticas \\ Universidad de Zaragoza\\ C/Pedro Cerbuna 12\\ 50009 Zaragoza\\ Spain\\ \href{mailto:oller@unizar.es}{\tt oller@unizar.es} \\ \ \\ Jos\'{e} Mar\'{i}a Grau\\ Departamento de Matematicas\\ Universidad de Oviedo\\ Avda.\ Calvo Sotelo, s/n, \\ 33007 Oviedo\\ Spain\\ \href{mailto:grau@uniovi.es}{\tt grau@uniovi.es} \end{center} \vskip .2 in \begin{abstract} Let $Z_{b}(n)$ denote the number of trailing zeroes in the base-$b$ expansion of $n!$. In this paper we study the connection between the expression of $\vartheta(b):=\lim_{n\rightarrow \infty}Z_{b}(n)/n$ in base $b$, and that of $Z_{b}(b^{k})$. In particular, if $b$ is a prime power, we will show the equality between the $k$ digits of $Z_{b}(b^{k})$ and the first $k$ digits in the fractional part of $\vartheta (b)$. In the general case we will see that this equality still holds except for, at most, the last $\left\lfloor \log _{b}(k)\ +3\right\rfloor $ digits. We finally show that this bound can be improved if $b$ is square-free and present some conjectures about this bound. \end{abstract} \section{Introduction} In what follows we let $Z_{b}(n)$ denote the number of trailing zeroes in the base-$b$ expansion of $n!$. It is a classic topic in elementary number theory to compute the number of trailing zeroes of the base-10 expansion of the factorial of an integer; i.e., $Z_{10}(n)$ (see \cite{GRI, GUP, NIV} for instance and \seqnum{A027868} of \emph{The On-Line Encyclopedia of Integer Sequences}). In fact, this question can be extended to arbitrary bases and the first author \cite{OLL} studied in detail the behavior of the function $Z_b$ (see \seqnum{A054861} for $b=3$ and \seqnum{A011371} for $b=2$). This is an old topic which has recently drawn attention due to the increasing computing possibilities and to the populary of computer algebra systems. In fact, we can find many sequences in the \emph{OEIS} which are related to this topic. For instance: \seqnum{A000966} (number of zeroes that $n!$ will never end in), \seqnum{A173558} (the smallest number whose factorial has $10^n$ trailing zeroes), \seqnum{A173292} (numbers whose factorial has exactly $10^n$ trailing zeroes), \seqnum{A181582} (smallest prime $p$ such that $p!$ ends with exactly $10^n$ trailing zeroes) or \seqnum{A173345} (the number of trailing zeroes of $n$ superfactorial) just to name a few. In recent work (Hart et al.\ \cite{HAR}, motivated by Schmuland \cite{SCH}), the following particularity about the number of trailing zeroes in the factorial of the powers of 10 (see \seqnum{A173228}) was shown: \begin{align*} Z_{10}(10)&=2,\\ Z_{10}(10^{2})&=24,\\ Z_{10}(10^{3})&=249,\\ Z_{10}(10^{4})&=2499,\\ Z_{10}(10^{5})&=24999,\\ Z_{10}(10^{6})&=249998,\\ Z_{10}(10^{7})&=2499999,\\ Z_{10}(10^{8})&=24999999,\\ Z_{10}(10^{9})&=249999998,\\ Z_{10}(10^{10})&=2499999997. \end{align*} Although the sequence of final 9's is broken for some values of the exponent, it seems clear that the number of 9's grows indefinitely. For instance, \begin{align*} Z_{10}(10^{50})& = 24999999999999999999999999999999999999999999999989,\\ Z_{10}(10^{100}) &= 2499999999999999999999999999999999999999999999999999999999\\ &999999999999999999999999999999999999999982. \end{align*} This behavior and the fact that the number of digits of $Z_{10}(10^m)$ is $m$, motivated the study of the asymptotic behavior of $\displaystyle{\frac{Z_{10}(10^k)}{10^k}}$ by Treuden \cite{TRE}, where it was shown (as suggested by the previous examples) that \begin{equation*} \lim_{n\rightarrow\infty}\frac{Z_{10}(n)}{n}=\frac{1}{4}. \end{equation*} Also, in \cite{TRE} it was suggested (and was proved in \cite{HAR}) that if $b=p_{1}^{r_{1}}\cdots p_{s}^{r_{s}}$, then \begin{equation*} \lim_{n\rightarrow \infty }\frac{Z_{b}(n)}{n}=\min_{1\leq i\leq s}\frac{1}{r_{i}(p_{i}-1)}. \end{equation*} Now, it is natural to wonder about what will be the behavior of the digits of $Z_b(b^k)$ for other values of $b$. Let us have a look at the case $k=20$ for various values of $b$. \begin{align*} Z_{2}(2^{20})&= 1048575,\\ Z_{3}(3^{20})&= 1743392200,\\ Z_{4}(4^{20})&= 549755813887,\\ Z_{5}(5^{20})&= 23841857910156,\\ Z_{6}(6^{20})&= 1828079220031481,\\ Z_{7}(7^{20})&= 13298711049602000,\\ Z_{8}(8^{20})&= 384307168202282325,\\ Z_{9}(9^{20})&= 3039416364764232200,\\ Z_{10}(10^{20})&= 24999999999999999996,\\ Z_{11}(11^{20})&= 67274999493256000920,\\ Z_{12}(12^{20})&= 1916879996223737561074,\\ Z_{13}(13^{20})&= 1583746981240066619900,\\ Z_{14}(14^{20})&= 13944709237547466926759,\\ Z_{15}(15^{20})&= 83131418251991271972652,\\ Z_{16}(16^{20})&= 302231454903657293676543,\\ Z_{17}(17^{20})&= 254014462915473282650100,\\ Z_{18}(18^{20})&= 3187059054099019543609340,\\ Z_{19}(19^{20})&= 2088331858752553232964200,\\ Z_{20}(20^{20})&= 26214399999999999999999991,\\ Z_{21}(21^{20})&= 46369738241158591439532728,\\ Z_{30}(30^{20})&= 87169610024999999999999999987. \end{align*} In the light of this data, it may seem that the only interesting behavior takes place at the multiples of 10. Nevertheless, this is not the case, as can be seen having a look at the base-$b$ expansion of the considered number: \begin{align*} Z_{2}(2^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{2},\\ Z_{3}(3^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{3},\\ Z_{4}(4^{20})&=\{1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3\}_{4},\\ Z_{5}(5^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{5},\\ Z_{6}(6^{20})&=\{2,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,5\}_{6},\\ Z_{7}(7^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{7},\\ Z_{8}(8^{20})&=\{2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5,2,5\}_{8},\\ Z_{9}(9^{20})&=\{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2\}_{9},\\ Z_{10}(10^{20})&=\{2,4,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,6\}_{10},\\ \end{align*} \begin{align*} Z_{11}(11^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{11},\\ Z_{12}(12^{20})&=\{5,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,10,10\}_{12},\\ Z_{13}(13^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{13},\\ Z_{14}(14^{20})&=\{2,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,4,9,1\}_{14},\\ Z_{15}(15^{20})&=\{3,11,3,11,3,11,3,11,3,11,3,11,3,11,3,11,3,11,3,7\}_{15},\\ Z_{16}(16^{20})&=\{3,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15\}_{16},\\ Z_{17}(17^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{17,}\\ Z_{18}(18^{20})&=\{4,8,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,17,14\}_{18},\\ Z_{19}(19^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{19},\\ Z_{20}(20^{20})&=\{4,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,19,11\}_{20},\\ Z_{21}(21^{20})&=\{3,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,5\}_{21},\\ Z_{22}(22^{20})&=\{2,4,8,17,13,4,8,17,13,4,8,17,13,4,8,17,13,4,8,14 \}_{22}, \\ Z_{23}(23^{20})&=\{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\}_{23},\\ Z_{24}(24^{20})&=\{7,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,18\}_{24},\\ Z_{25}(25^{20})&=\{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3\}_{25}. \end{align*} Of course, the origin of these cyclic repetitions is closely related to the periodic expression of $\vartheta(b)=\displaystyle{\lim_{n\rightarrow\infty}\frac{Z_b(n)}{n}}$ when expressed in the base $b$. In this paper we study the relation between $\vartheta(b)$ and the base-$b$ expansion of $Z_b(b^k)$. If $b$ is a prime power, we will show the equality between the $k$ digits of $Z_b(b^k)$ and the first $k$ digits in the fractional part of $\vartheta(b)$ (i.e., $\lfloor\vartheta(b)b^k\rfloor$). In the general case this equality does not hold. We are then interested in investigating the number of final digits of $Z_b(b^k)$ which break the previous coincidence. To do so, let us consider $\eta(b,k):=\lfloor\log_b(\lfloor\vartheta(b)b^k\rfloor-Z_b(b^k))+1\rfloor$. This represents the number of digits of the base-$b$ expansion of $\lfloor\vartheta(b)b^k\rfloor-Z_b(b^k)$ and observe that the number of unequal final digits between $\lfloor\vartheta(b)b^k\rfloor$ and $Z_b(b^k)$ is at most $\eta(b,k)+1$. We will show that $$\eta(b,k)\leq\lfloor\log_b k+2\rfloor$$ is the best possible upper bound for $\eta(b,k)$. Nevertheless, we will improve this upper bound in the case when $b$ is square-free and present some conjectures about this bound. Observe that if $\vartheta(b)$ admits a finite expansion in base $b$ (we will say that $\vartheta(b)$ is {\em exact} in base $b$), then it admits two different $b$-adic expansions: the finite natural one and the infinite one. Throughout the paper we will always consider the latter and we will understand the floor function as the truncation of the fractional part. Consequently, if $\vartheta(b)$ is exact, then $\lfloor\vartheta(b)b^k\rfloor$ is to be interpreted as $\vartheta(b)b^k-1$. For instance, if $b=10$ and $k=6$ then $\vartheta(10)=\frac14$ and we will consider $\frac14=0.24999\cdots$ Thus $\lfloor\vartheta(10)10^6\rfloor$ will be interpreted as $249999=250000-1=\vartheta(10)10^6-1$. The paper is organized as follows. In Section \ref{S2} we present the basic facts and technical results that will be used in the rest of the paper. In Section \ref{S3} we study the prime-power case, establishing the equality between the $k$ digits of $Z_b(b^k)$ and the first $k$ digits of the base-$b$ expansion of $\vartheta(b)$. Finally, in Section \ref{S4}, we study the general case, where the latter equality does not hold and give a bound to the number of unequal digits. \section{Technical results} \label{S2} In this section we present some technical results which will be very useful in the sequel. Some of them are well-known and are presented without proof. The section is divided into three parts, the first is devoted to results related to $Z_b(b^k)$, the second mostly deals with the base-$b$ expansion of $\vartheta(b)$ when $b$ is a prime-power and the third one is devoted to present the main lemma which will be crucial in the paper. \subsection{Some results about $Z_b(n)$} We start this subsection with the following well-known lemma, which was first proved by Legendre \cite{LEG}, that we present without proof. \begin{lemma} \ \begin{enumerate} \item $\displaystyle{Z_p(n)=\sum_{i\geq1}\left\lfloor\frac{n}{p^i}\right\rfloor=\frac{n-\sigma_p(n)}{p-1}}$, where $\sigma_p(n)$ is the sum of the digits of the base-$p$ expansion of $n$. \item $Z_{p^r}(n)=\left\lfloor\displaystyle{\frac{Z_p(n)}{r}}\right\rfloor$ for every $r\geq1$. \item If $b=p_1^{r_1}\cdots p_s^{r_s}$, then $Z_b(n)=\displaystyle{\min_{1\leq i\leq s}} Z_{p_i^{r_i}}(n)$. \end{enumerate} \end{lemma} As a straightforward consequence of the preceding lemma we obtain the following corollary. \begin{corollary}\label{C1} Let $l$ be any integer and $p$ be a prime. Then $$Z_p(lp^n)=lZ_p(p^n)+Z_p(l).$$ \end{corollary} Recall that $\vartheta(b)=\displaystyle{\lim_{n\rightarrow\infty}\frac{Z_b(n)}{n}}$. In previous work \cite{HAR, TRE} an explicit expression for $\vartheta(b)$ was given. Namely, \begin{proposition} If $b=p_1^{r_1}\cdots p_s^{r_s}$, then $$\vartheta(b)=\min_{1\leq i\leq s}\frac{1}{r_i(p_i-1)}.$$ \end{proposition} \begin{remark} The sequence $S_n=\dfrac{1}{\vartheta(n)}$ appears in \emph{The On-Line Encyclopedia of Integer Sequences} as sequence \seqnum{A090624}. It is interesting to observe that it was included in the Encyclopedia 5 years before the formula for $\vartheta(n)$ was found. \end{remark} The following lemma will be of great importance in sections \ref{S3} and \ref{S4}. \begin{lemma}\label{L2} Let $k\geq 0$ be an integer. \begin{enumerate} \item If $b>1$ is an integer, then: $$00$). Clearly $t$ can be arbitrarily large and the length of the period can be any multiple of $s$, so we will usually assume that $t$ and $s$ are minimal. We will say that $q$ is exact in base $b$ if there exists $k\geq 1$ such that $d_i=0$ for every $i\geq k$ or $d_i=b-1$ for every $i\geq k$; i.e., $$q=\{d.d_{1}d_{2}\cdots d_{t}\overbrace{b-1} \, \}_{b} = \{d.d_{1}d_{2} \cdots d_{t}+1% \overbrace{0} \, \}_{b}$$ \begin{lemma} Let $p$ be a prime and $1\leq r\in\mathbb{Z}$. Then $\dfrac{1}{r(p-1)}$ is exact in base $p^r$ if and only if $p=2$ and $r$ is a power of 2. \end{lemma} \begin{proof} This is a straightforward consequence from the fact that $\dfrac{1}{n}$ is exact in base $p^r$ if and only if $\textrm{rad}(n)=p$; i.e., if and only if $n$ is a power of $p$. \end{proof} Now we will present some results about the base-$b$ expansion of $\vartheta(b)$ when $b=p^n$ is a prime-power. \begin{lemma} \label{L4} Let $p$ be a prime and $b=p^n$ with $n\in\mathbb{N}$. Then $$\vartheta (p^{n})=\{0.d_{1}d_{2}\cdots d_{t}\overbrace{d_{t+1}\cdots d_{t+s}}\}_{b}\Longleftrightarrow \frac{p^{nt}}{n}\sum_{i=0}^{sn-1}p^{i}\in \mathbb{Z}.$$ \end{lemma} \begin{proof} First of all observe that $$\frac{p^{nt}}{n}\sum_{i=0}^{sn-1}p^{i}=\frac{p^{nt}(p^{sn}-1)}{n(p-1)}=b^{t}\vartheta (p^{n})(b^{s}-1).$$ Let us suppose that $\vartheta (p^{n})=\{0.d_{1}d_{2}\cdots d_{t}\overbrace{d_{t+1}\cdots d_{t+s}} \}_{b}$. Then we have that \begin{align*} b^{t}\vartheta(p^{n})& =\{d_{1}d_{2}\cdots d_{t}.\overbrace{d_{t+1}\cdots d_{t+s}}\}_{b},\\b^{t+s}\vartheta (p^{n})& = \{d_{1}d_{2}\cdots d_{t}d_{t+1}\cdots d_{t+s}.\overbrace{ d_{t+1}\cdots d_{t+s}}\}_{b}. \end{align*} and it is enough to subtract both expressions to obtain that $b^{t}\vartheta (p^{n})(b^{s}-1)\in \mathbb{Z}$. Conversely, assume that $b^{t}\vartheta (p^{n})(b^{s}-1)\in\mathbb{Z}$. It is easy to see that there exists a sequence $\{d_{i}\}_{i\in \mathbb{N}}\subset \mathbb{N}$, not eventually null, such that $$\vartheta (p^{n})=\sum_{i=1}^{\infty }d_{i}p^{-ni}\ \textrm{with}\ 0\leq d_{i}1$, then $S_{k}=\ell b^{k}-1$ for every $k>1$. \item If $\ell$ is not exact in base $b$, then $S_{k}=\left\lfloor \ell b^{k}\right\rfloor $ for every $k$. \item If $\ell =\sum_{i=1}^{\infty }b^{-i}\Delta _{n}\in \mathbb{Q}$, then there exists $(t,s)\in \mathbb{N}^{2}$ with $s>0$ such that $\Delta _{n+s}=\Delta _{n}$ (and $S_{n+s}=S_{n})$ for all $n>t$. \end{enumerate} \end{lemma} \begin{proof} \begin{enumerate} \item It follows from inductive arguments, since $S_1=\Delta_1$. \item Consequence of (1). \item Observe that $\displaystyle{\frac{S_{n}}{b^{n}}=\sum_{i=1}^{n}b^{-i}\Delta _{i}}$ and take limits. \item We must consider two cases. If $\Delta _{1}<(b-1)$, then $\ell=\frac{(\Delta _{1}+1)}{b}$, $\ell b^{k}-1=(\Delta _{1}+1)b^{k-1}-1$ and also $$S_{k}=\sum_{i=1}^{k}b^{k-i}\Delta _{i}=\Delta _{1}b^{k-1}+\sum_{i=2}^{k}b^{k-i}(b-1)=\Delta _{1}b^{k-1}+b^{k-1}-1.$$ Now, if $\Delta _{1}=b-1$, then $\ell =1$ and $$S_{k}=\sum_{i=1}^{k}b^{k-i}(b-1)=\sum_{i=1}^{k}b^{k+1-i}-\sum_{i=1}^{k}b^{k-i}=b^{k}-1.$$ \item Observe that $$\ell b^{k}=\sum_{i=1}^{\infty }b^{k-i}\Delta _{i}=\sum_{i=1}^{k}b^{k-i}\Delta _{i}+\sum_{i=1}^{\infty }b^{-i}\Delta _{i+k}.$$ Now, if $\ell$ is not exact, it follows that $\displaystyle{\sum_{i=1}^{\infty }b^{-i}\Delta _{i+k}<1}$ and consequently, $$\left\lfloor \ell b^{k}\right\rfloor =\left\lfloor \sum_{i=1}^{k}b^{k-i}\Delta _{i}+\sum_{i=1}^{\infty }b^{-i}\Delta _{i}\right\rfloor =\sum_{i=1}^{k}b^{k-i}\Delta _{i}=S_{k}.$$ \item It is clear since the base-$b$ expansion of any rational number is periodic. \end{enumerate} \end{proof} \section{The prime power case}\label{S3} The next theorem establishes the equality between the digits of the base-$b$ expansion of $Z_b(b^k)$ and the first $k$ digits of the base-$b$ expansion of $\vartheta(b)$ if $b$ is a prime power. In passing we will also prove some other interesting properties. \begin{theorem}\label{T1} Let $p$ be a prime and $b=p^n$. Consider the sequence $a_{1}=Z_{b}(b)$, $a_{k}:=Z_{b}(b^{(k+1)})-bZ_{b}(b^{k})$ and let $s$ be the smallest integer such that $\displaystyle{\theta :=\frac{b}{n}\sum_{i=0}^{sn-1}p^{i}\in \mathbb{Z}}$. Then, the following items hold: \begin{enumerate} \item $\displaystyle{Z_{b}(b^{k})=\sum_{i=1}^{k}a_{i}b^{k-i}}$. \item $\displaystyle{\vartheta (b)=\lim_{n\rightarrow \infty }\frac{Z_{b}(b^{n})}{b^{n}} =\sum_{i=1}^{\infty }b^{-i}a_{i}}$. \item The base-$b$ expansion of $\vartheta(b)$ is \begin{equation*} \vartheta (b)= \begin{cases} \{0.a_{1}\overbrace{a_{2}\cdots a_{s+1}}\}_{b}, & \text{ if $\dfrac{\theta}{b}\notin \mathbb{Z} $ } ; \\ \{0.\overbrace{a_{1}a_{2}\cdots a_{s}}\}_{b} & \text{ if $\dfrac{\theta }{b}\in \mathbb{Z}$ } . \end{cases} \end{equation*} \item $a_{k}=a_{k+s}$ for all $k>1$. Moreover, if $\dfrac{\theta }{b}\in \mathbb{Z}$, then $a_{k}=a_{k+s}$ for all $k>0$. \item \begin{equation*} \#\{a_{k}\}_{i\in \mathbb{N}}= \begin{cases} s, & \text{ if }\dfrac{\theta }{b}\in \mathbb{Z}; \\ s+1,\text{ otherwise.} \end{cases} \end{equation*} \item If $\dfrac{\theta }{b}\in \mathbb{Z}$, then $Z_{b}(b^{s})=\dfrac{\theta }{b}$. Otherwise, $Z_{b}(b^{s+1})=\theta +Z_{b}(b)$. \item If $b+1$ is not a Fermat number, then $Z_{b}(b^{k})=\left\lfloor b^{k}\vartheta (b)\right\rfloor$. \item If $b+1$ is a Fermat number, then $Z_{b}(b^{k})=b^{k}\vartheta (b)-1$. \end{enumerate} \end{theorem} \begin{proof} First of all observe that, due to Corollary \ref{C2}, there exists an integer $s$ such that $\displaystyle{\theta =\frac{b}{n}\sum_{i=0}^{sn-1}p^{i}\in \mathbb{Z}}$ or, equivalently, such that $\vartheta (p^{n})=\{0.d_{1}\overbrace{d_{2}\cdots d_{s+1}}\}_{b}$. Moreover, if $\displaystyle{\frac{1}{n}\sum_{i=0}^{sn-1}p^{i}\in \mathbb{Z}}$, then $\vartheta (p^{n})=\{0.\overbrace{d_{1}\cdots d_{s}}\}_{b}$. Also, by Lemma 2, we have that $00$. \end{proposition} \begin{proof} $\displaystyle{\frac{\gamma_{k+1}}{\gamma_k}=\frac{Z_b(b^{k+1})}{bZ_b(b^k)}>1}$ due to Lemma \ref{L2}(1). \end{proof} We have already seen in the previous section that if $b$ is a prime power, then the number of digits of the base-$b$ expansion of $Z_b(b^k)$ is exactly $k$. Now we will see that this is also true for a general $b$. \begin{proposition} The number of digits of the base-$b$ expansion of $Z_{b}(b^{k})$ is exactly $k$; i.e., $$\left\lfloor \log_{b}Z_{b}(b^{k})\right\rfloor +1=k.$$ \end{proposition} \begin{proof} By Lemma 2 (1), we know that $bZ_{b}(b^{k})k_{0}$ for certain $k_{0}$. Then $1+\left\lfloor\log _{b}Z_{b}(b^{m})\right\rfloor>m$ for every $m\geq k_{0}$. This clearly implies that $\displaystyle{\frac{Z_{b}(b^{m})}{b^{m}}>1}$ for every $m>k_{0}$ and $\displaystyle{\vartheta(b)=\lim_{n\rightarrow\infty}\frac{Z_{b}(b^{m})}{b^{m}}\geq 1}$, which is clearly a contradiction since by definition $\vartheta (b)\leq 1$, the equality only holds for $b=2$ and $\displaystyle{\frac{Z_2(2^m)}{2^m}=\frac{2^m-1}{2^m}<1}.$ \end{proof} We have seen that in the general case the equality between the $k$ digits of $Z_b(b^k)$ and the first $k$ digits of the base-$b$ expansion of $\vartheta(b)$ does not hold. It is then interesting to study how many digits differ. To do so, let us introduce some notation: $$\alpha(b,k)=\lfloor\vartheta(b)b^k\rfloor-Z_b(b^k).$$ $$\eta(b,k)=\lfloor\log_b\alpha(b,k)+1\rfloor.$$ Observe that the number of different digits that we are studying is, at most, $\eta(b,k)+1$. Now we can give an upper bound for $\eta(b,k)$. \begin{theorem}\label{T2} The number of digits of the base-$b$ expansion of $\alpha(b,k)$ is smaller or equal than the number of digits of the base-$b$ expansion of $k$, plus 1; i.e., $$\eta(b,k)\leq\lfloor\log_b k +2\rfloor.$$ \end{theorem} \begin{proof} If $k=1$, then $\lfloor\vartheta(b)b\rfloor-Z_b(b)\leq b$, since $\vartheta(b)\leq1$ and $Z_b(b)\geq0$. This implies that $\eta(b,1)=\lfloor\log_b\left(\lfloor\vartheta(b)b\rfloor-Z_b(b)\right)+1\rfloor\leq\lfloor\log_b b +1\rfloor=2=\lfloor\log_b k +2 \rfloor$, as claimed. Now, let $k\geq 2$. Put $b=p_1^{r_1}\cdots p_s^{r_s}$ and assume, without loss of generality, that $p_1$ is such that $\displaystyle{\min_{1\leq i\leq s}\frac{1}{r_i(p_i-1)}=\frac{1}{r_1(p_1-1)}}$. In that case $\displaystyle{Z_b(b^k)=\left\lfloor\frac{b^k-\sigma_{p_1}(b^k)}{r_1(p_1-1)}\right\rfloor}$ and $\vartheta(b)=\displaystyle{\frac{1}{r_1(p_1-1)}}$. Also observe that if $\beta=\dfrac{b}{p_1^{r_1}}$, then $\sigma_{p_1}(b^k)=\sigma_{p_1}(\beta^k)$. Now \begin{align*} \lfloor\vartheta(b)b^k\rfloor-Z_b(b^k) &=\lfloor\vartheta(b)b^k\rfloor-\left\lfloor\frac{b^k-\sigma_{p_1}(b^k)}{r_1(p_1-1)}\right\rfloor\leq\frac{b^k-(b^k-\sigma_{p_1}(b^k))}{r_1(p_1-1)}+1\\ &=1+\frac{\sigma_{p_1}(\beta^k)}{r_1(p_1-1)}\leq 1+\frac{(p_1-1)(1+\lfloor\log_{p_1}\beta^k\rfloor}{r_1(p_1-1)}\\ &=1+\frac{1+\lfloor\log_{p_1}\beta^k\rfloor}{r_1}\leq 2+\lfloor\log_{p_1}\beta^k\rfloor=\lfloor\log_{p_1} p_1^2\beta^k\rfloor\\ &\leq\lfloor\log_{p_1} b^k\rfloor. \end{align*} Consequently we find \begin{eqnarray*} \eta(b,k) &= & \left\lfloor\log_b\left(\lfloor\vartheta(b)b^k\rfloor-Z_b(b^k)\right) +1\right\rfloor\leq\left\lfloor\log_b\left(\lfloor\log_{p_1} b^k\rfloor\right)\right\rfloor +1\leq \lfloor\log_b (k \log_{p_1} b)\rfloor +1 \\ &=& \lfloor\log_b k+\log_b\log_{p_1} b\rfloor+1\leq\lfloor\log_b k\rfloor +2=\lfloor\log_b k +2\rfloor . \end{eqnarray*} \end{proof} \begin{remark} The bound obtained in the previous theorem is the best possible one. In fact, there exists values of the pair $(b,k)$ such that $\eta(b,k)=\lfloor\log_b k +2\rfloor$. Namely, if $k=b-1$ and $b<1000$ the following values: $$b=120,\ 180,\ 240,\ 336,\ 360,\ 378,\ 420,\ 448,\ 504,\ 560,\ 630,\ 672,\ 720,\ 756,\ 840,\ 945$$ satisfy the equation $\eta(b,b-1)=2=\lfloor\log_b (b-1) +2\rfloor$. \end{remark} \begin{corollary} The number of unequal digits between $Z_b(b^k)$ and the first $k$ digits of the base-$b$ expansion of $\vartheta(b)$ is smaller or equal than the number of digits of $k$ plus 2. \end{corollary} \begin{proof} The number of unequal digits is, at most, $\eta(b,k)+1$ which, by the previous theorem, is smaller or equal than $\left(\lfloor\log_b k\rfloor +1\right)+2$. \end{proof} \begin{remark} It is interesting to observe that, as far as the authors have been able to test computationally, the inequality given in the preceding corollary is strict. Nevertheless we have not found a proof for this fact, so it remains a conjecture. \end{remark} \begin{conjecture} The number of unequal digits between $Z_b(b^k)$ and the first $k$ digits of the base-$b$ expansion of $\vartheta(b)$ is smaller or equal than the number of digits of $k$ plus 1. \end{conjecture} If $b$ is square-free, we can improve the bound given in Theorem \ref{T2}. \begin{proposition} Let $b=p_1\cdots p_s$ be a square-free integer ($s\geq 2$). Then $\vartheta(b)b^k-Z_b(b^k)\leq k(s-1)$ for every $k$. As a consequence $\eta(b,k)\leq \lfloor\log_b k+\log_b(s-1)+1\rfloor\leq\lfloor\log_b k +1.21\rfloor$. \end{proposition} \begin{proof} We can suppose, without loss of generality, that $p_1$ is the greatest prime in the decomposition of $b$. Then $\displaystyle{\vartheta(b)b^k=\frac{b^k}{p_1-1}}$ and also $Z_b(b^k)=Z_{p_1}(b^k)=\displaystyle{\frac{b^k-\sigma_{p_1}(b^k)}{p_1-1}}$. Consequently $\displaystyle{\vartheta(b)b^k-Z_b(b^k)=\frac{\sigma_{p_1}(b^k)}{p_1-1}=\frac{\sigma_{p_1}(p_2^k\cdots p_s^k)}{p_1-1}}$. Now, since $(p_2\cdots p_s)^k