1 Introduction

The Fibonacci sequence\((F_{n})_{n}\) is one of the most famous sequences in mathematics. This sequence starts with 0 and 1 and each term afterwards is the sum of the two preceding ones. So, its first terms are \(0, 1, 1, 2, 3, 5, 8, 13\), and so on. A well-known non-recursive formula for the nth Fibonacci number is the Binet-formula

$$ F_{n}= \frac{\alpha ^{n}-\beta ^{n}}{\sqrt{5}}, $$

where \(\alpha:=(1+\sqrt{5})/2\) and \(\beta:=(1-\sqrt{5})/2\) (for more details see [1, 4, 7, 20]).

There are many authors interested in problems related to divisibility properties of Fibonacci numbers (see e.g. [3, 8]). In this direction, we define, for any positive integer n, the order of apparition (or the rank of appearance) of n in the Fibonacci sequence, denoted by \(z(n)\), as the minimum element of the set \(\{k\geq 1: n\mid F_{k}\}\). This function is well defined by a result of Lucas [9, p. 300] (in 1878), and in fact a simple combinatorial argument yields \(z(n)\leq n^{2}\) for all positive integers n. We note that there is not a general closed formula for the \(z(n)\), and therefore Diophantine equations related to \(z(n)\) play an important role in its best comprehension (see [10, 16, 17, 19]). A number of authors have considered, in varying degrees of generality, the problem of determining a special closed formula for \(z(n)\), when n is a number which is related to a sum or a product of terms of Fibonacci and Lucas sequences (see, for example, [5, 6, 11, 18] and the references therein).

In 1975, Sallé [13] showed that \(z(n)\leq 2n\) for all positive integers n and, moreover, he also found the explicit form of all integers n for which the equality is attained. In fact, it holds that

$$ z(n) = 2n \quad\text{if and only if}\quad n = 6\cdot 5^{k}\quad \text{for } k \geq 0. $$
(1)

In particular, \(\limsup_{n\to \infty }z(n)/n=2\). However, apart from these cases this upper bound is very weak. For instance, \(z(2255)=20<10^{-2}\cdot 2255\). In fact, Marques [12] proved the existence of sharper upper bounds for the z-function which hold whenever \(n\neq 6\cdot 5^{k}\), where \(k\geq 0\). These upper bounds become better as \(\omega (n)\) increases (where, as usual, \(\omega (n)\) is the number of distinct prime factors of n). By using these bounds, he deduced that

$$ \liminf_{n\to \infty }\frac{z(n)}{n}=0. $$
(2)

However, the proof of the previous fact does not need Marques’ upper bounds since, for \(n>2\), \(z(F_{n})/F_{n}=n/F_{n}\) tends to 0 as \(n\to \infty \) (since \(F_{n}\geq (\sqrt{2})^{n-2}\)). Indeed, in order to derive this, he used the primorial number of the nth prime, denoted by \(p_{n}\#\), which is defined as the product of the first n prime numbers. It is well known that the primorial numbers are rarer (in some sense) than Fibonacci numbers (see Remark 1 for the formal meaning).

In this paper, we are interested in two problems related to the growth of \(z(n)\). The first one is about the proportion of positive integers such that \(z(n)/n\) is sufficiently small. To be more precise, for a real number \(\epsilon >0\), we define

$$ \mathcal{N}_{\epsilon }= \bigl\{ n\in \mathbb{Z}_{>0}: z(n)/n< \epsilon \bigr\} . $$

Note that \(\mathcal{N}_{\epsilon }=\mathbb{Z}_{>0}\) for all \(\epsilon \geq 2\) (by Sallé’s result). See also Fig. 1. By (2), we know that the set \(\mathcal{N}_{\epsilon }\) is infinite for all \(\epsilon >0\). However, by using only Fibonacci numbers in order to have \(z(F_{n})/F_{n}<\epsilon \), we obtain a zero natural density set of positive integers belonging to \(\mathcal{N}_{\epsilon }\). Recall that if \(\mathcal{A}\) is a set of positive integers, the natural density of \(\mathcal{A}\), denoted by \(\delta (\mathcal{A})\), is the following limit (if it exists):

$$ \delta (\mathcal{A}):= \lim_{x\to \infty } \frac{\#\mathcal{A}(x)}{x}, $$

where \(\mathcal{A}(x):=\mathcal{A}\cap [1,x]\) (for \(x>0\)). For example, clearly, \(\delta (\mathcal{N}_{\epsilon })=1\) for all \(\epsilon \geq 2\). We recall that a property is said to be satisfied by almost all positive integers if the set of positive integers, for which this property holds, has natural density 1.

Figure 1
figure 1

The scatterplot of the function \(z(n)\) for values of n from 1 to \(50\text{,}000\). The regions \(\epsilon n< z(n)\leq (\epsilon +0.1)n\), \(\epsilon \in \{0, 0.1, \ldots, 1.9\}\) are colored by the corresponding value of ϵ

Thus, our first result states, in particular, that almost all positive integers belong to \(\mathcal{N}_{\epsilon }\) for all \(\epsilon >0\). More precisely,

Theorem 1

There exists a positive constantcsuch that, for all\(\epsilon >0\), the estimate

$$ \# \mathcal{N}_{\epsilon }(x)\geq x- \frac{c\,x}{(\log \log x)^{1/2}} $$

holds for all sufficiently largex.

As an immediate consequence, we have

Corollary 1

For all\(\epsilon >0\), one has that\(\delta (\mathcal{N}_{\epsilon })=1\).

The second problem which will be treated here is about a “Mertens-like” function related to \(z(n)\) (recall that the Mertens function\(M(m):=\sum_{n=1}^{m}\mu (n)\), where \(\mu (n)\) is the Möbius function). Let m be a positive integer, we define the z-summation function\(Z(m):=\sum_{n=1}^{m}z(n)\). This function can be also defined over the positive real numbers by \(Z(x):=Z(\lfloor x\rfloor )\) (we can also denote \(Z(x):=\sum_{n\leq x}z(n)\), see Fig. 2).

Figure 2
figure 2

The graphs of the functions \(Z(x)\), \(\frac{x^{2}}{(\log x)^{1/3}}\) and \(x\lceil x\rceil \) for \(x\in (0,700]\)

Since \(z(n)\leq 2n\), then we have the direct estimate

$$ Z(x)\leq x\lceil x\rceil $$
(3)

for all \(x\geq 1\). In particular, \(Z(x)=O(x^{2})\) (here, we use the Landau symbolO to say that \(f(x)=O(g(x))\) if there exists a positive constant M such that \(|f(x)|\leq M|g(x)|\) for all sufficiently large x, i.e., the same meaning as \(f\ll g\)). Theorem 1 implies that \(z(n)/n\) can be made arbitrarily small, with probability 1 (i.e., \(\delta (\mathcal{N}_{\epsilon })=1\)), and so it suggests the existence of a substantially better upper bound for \(Z(x)\). In fact, the following theorem holds.

Theorem 2

We have that

$$ Z(x)=O \biggl( \frac{x^{2}}{(\log x)^{1/3}} \biggr). $$
(4)

The proof of these results combines some new (sharper upper bounds for \(z(n)\) due to Marques) and classical results (such as a result due to Sathé and Selberg) in number theory.

The graphs of the functions in Fig. 2 show that our upper bound (4) is much sharper than upper bound (3).

2 Auxiliary results

A consequence of Marques’ theorems (in [12]) will be an essential ingredient in our proof. Therefore, we shall present his results as lemmas (in what follows \(\nu _{2}(n)\) denotes the 2-adic valuation of n, i.e., the largest exponent of 2 in the prime factorization of n).

Lemma 1

(Theorem 1.1 of [12])

We have

  1. (i)

    \(z(2^{k})=3\cdot 2^{k-2}\) (for\(k\geq 3\)), \(z(3^{k})=4\cdot 3^{k-1}\) (for\(k\geq 1\)), and\(z(5^{k})=5^{k}\) (for\(k\geq 0\)).

  2. (ii)

    If\(p>5\)is a prime, then

    $$ z \bigl(p^{k} \bigr)\leq \biggl(p- \biggl( \frac{5}{p} \biggr) \biggr)p^{k-1}\quad \textit{for } k\geq 1, $$

    where, as usual, \((\frac{a}{q})\)denotes the Legendre symbol ofawith respect to a prime\(q>2\).

Lemma 2

(Theorem 1.2 of [12])

Letnbe an odd integer with\(\omega (n)\geq 2\), then

$$ z(n)\leq 2\cdot \biggl( \frac{2}{3} \biggr)^{\omega (n)- \delta _{n}}n, $$

where

$$ \delta _{n} = \textstyle\begin{cases} 0 & \textit{if } 5\nmid n; \\ 1 & \textit{if } 5\mid n . \end{cases} $$

Lemma 3

(Theorem 1.3 of [12])

Letnbe an even integer with\(\omega (n)\geq 2\), it holds that

  1. (i)

    If\(\nu _{2}(n)\geq 4\), then

    $$ z(n)\leq \frac{3}{4}\cdot \biggl( \frac{2}{3} \biggr)^{\omega (n)-\delta _{n}-1}n. $$
  2. (ii)

    If\(\nu _{2}(n)=1\), then

    $$ z(n) \leq \textstyle\begin{cases} 3n/2& \textit{if } \omega (n)=2 \textit{ and } 5\mid n; \\ 2n& \textit{if } \omega (n)=2 \textit{ and } 5\nmid n; \\ 3\cdot (2/3)^{\omega (n)-\delta _{n}-1}n & \textit{if } \omega (n)>2. \end{cases} $$
  3. (iii)

    If\(\nu _{2}(n)\in \{2,3\}\), then

    $$ z(n) \leq \textstyle\begin{cases} 3n/2& \textit{if } \omega (n)=2 \textit{ and } 5\mid n; \\ n& \textit{if } \omega (n)=2 \textit{ and } 5\nmid n; \\ (2/3)^{\omega (n)-\delta _{n}-2}n & \textit{if } \omega (n)>2. \end{cases} $$

The next two lemmas are powerful results in analytic number theory which are related to positive integers with fixed number of distinct prime factors.

Lemma 4

(Sathé–Selberg formula)

For any positive constantA, we have

$$ \#\mathcal{P}_{k}(x):=\# \bigl\{ n\leq x: \omega (n)= k \bigr\} \sim G \biggl( \frac{k-1}{\log \log x} \biggr) \frac{x}{\log x} \frac{(\log \log x)^{k-1}}{(k-1)!} $$

for\(x\geq 3\)and\(1\leq k\leq A\log \log x\), where

$$ G(z):=\frac{1}{\varGamma (1+z)}\prod_{p\ \mathrm{prime}} \biggl(1+ \frac{z}{p} \biggr) \biggl(1-\frac{1}{p} \biggr)^{z}. $$

In the previous statement \(\varGamma (z)=\int _{0}^{\infty }x^{z-1}e^{-x}\,dx\) (for \(x>0\)) is the well-known gamma function and, as usual, for two positive functions \(f(x)\) and \(g(x)\), we say that \(f \sim g\) (i.e., f is asymptotically equivalent to g) if \(f(x)/g(x)\) tends to 1 as \(x\to \infty \).

Lemma 5

(Turán–Kubilius inequality)

We have that

$$\sum_{n\leq x}\big(\omega(n)-\log \log x\big)^{2}=O(x\log \log x). $$

The proof of Lemmas 4 and 5 can be found in [14, 15] and [2, Theorem 7.2], respectively.

Remark 1

In the text right after (2), we said that the primorial numbers are rarer than Fibonacci numbers. Indeed, this is true because, in light of the previous definition, we have \(F_{n} \sim \alpha ^{n}/\sqrt{5}\) while \(p_{n}\# \sim n^{(1+o(1))n}\) (where, in this case, \(o(1)\) means a function which tends to 0 as \(n\to \infty \)).

As usual, from now on we utilize the notation \([a,b]=\{a,a+1,\ldots, b\}\) for any integers \(a< b\).

Now we are ready to deal with the proof of our results.

3 The proofs

3.1 The proof of Theorem 1

We can deduce by Lemmas 1, 2, and 3 that

$$ z(n)\leq 7 \biggl( \frac{2}{3} \biggr)^{\omega (n)}n $$

for all \(n>1\). Thus, to obtain the inequality \(z(n)/n<\epsilon \), it suffices that \(7\cdot (2/3)^{\omega (n)}<\epsilon \). This inequality holds when \(\omega (n)>\log (\epsilon /7)/\log (2/3)\). Therefore, for \(k:=\lceil \log (\epsilon /7)/\log (2/3)\rceil \), we have

$$\begin{aligned} \# \mathcal{N}_{\epsilon }(x) & \geq \# \bigl\{ n\leq x: \omega (n)>k \bigr\} \\ & = x - \# \bigl\{ n\leq x: \omega (n)\leq k \bigr\} \\ & = x - \sum_{t=1}^{k}\# \mathcal{P}_{t}(x) \geq x - \sum_{t\geq 1}\# \mathcal{P}_{t}(x) . \end{aligned}$$

Thus, to finish the proof, it is enough to show that

$$ \#\mathcal{P}_{t}(x)\ll \frac{x}{\sqrt{\log \log x}}, $$
(5)

for all t.

Now, the proof conveniently splits into two cases:

Case 1

If \(t\leq 2\log \log x\). Note that since \(G(z)\) converges uniformly and absolutely in any bounded set, we have \(\max_{z\in [0,2]}\{|G(z)|\}\leq C\), for some positive constant C. Now, by Lemma 4 for \(A=2\), we get \(|G(z_{t})|\leq C\) (for \(z_{t}:=(t-1)/\log \log x<2\)) and

$$\begin{aligned}& \#\mathcal{P}_{t}(x) \ll \frac{x}{\log x}\frac{(\log \log x)^{t-1}}{(t-1)!}. \end{aligned}$$

By the Stirling’s formula (i.e., \(n!\geq \sqrt{2\pi}n^{n+1/2}e^{-n}\)), the previous inequality can be written as

$$\begin{aligned}& \#\mathcal{P}_{t}(x) \ll \frac{x}{\sqrt{t-1}\log x}\bigg(\frac{e\log \log x}{t-1}\bigg)^{t-1}. \end{aligned}$$

However (by a straightforward calculation), for a given \(A>1\), the function \(f(y):=(A/y)^{y}\) has its maximum value \(e^{A/e}\) which is attained at \(y=A/e\). Thus, if \(A=e\log \log x\), then \(f(t-1)\leq e^{\log \log x}=\log x\) and so

$$ \#\mathcal{P}_{t}(x) \ll \frac{x}{\sqrt{\log \log x}}. $$
(6)

Case 2

If \(t> 2\log \log x\). In this case, for \(\omega(n)=t>2\log \log x\), then \(\omega(n)-\log \log x>\log \log x\) and therefore

$$\begin{aligned} \sum_{n\leq x}\bigl(\omega(n)-\log \log x\bigr)^{2} \geq & \sum_{n\leq x, \omega(n)=t}\bigl(\omega(n)-\log \log x\bigr)^{2}\\ \geq & \sum_{n\leq x, \omega(n)=t}(\log \log x)^{2}=\#\mathcal{P}_{t}(x)(\log \log x)^{2}. \end{aligned}$$

Since \(\sum_{n\leq x}(\omega(n)-\log \log x)^{2} = O(x\log \log x)\) (by Lemma 5), we deduce that

$$ \#\mathcal{P}_{t}(x)\ll \frac{x}{\log \log x}. $$
(7)

In conclusion, inequalities (6) and (7) imply (5), as desired.

3.2 Proof of Corollary 1

By definition of natural density and by Theorem 1, we have

$$\begin{aligned} \delta (\mathcal{N}_{\epsilon }) = \lim_{x\to \infty } \frac{\#\mathcal{N}_{\epsilon }(x)}{x} \geq \lim_{x\to \infty } \biggl(1 - \frac{c}{\sqrt{\log \log x}} \biggr)=1, \end{aligned}$$

which implies the desired result.  □

3.3 The proof of Theorem 2

By using that \(z(n)\leq 7\cdot (2/3)^{\omega(n)}n\), we have that

$$Z(x)\ll x \sum_{k=1}^{h(x)}\sum_{n\in \mathcal{P}_{k}(x)}\bigg(\frac{2}{3}\bigg)^{\omega(n)}\ll x \sum_{k=1}^{h(x)} \bigg(\frac{2}{3}\bigg)^{k}\#\mathcal{P}_{k}(x), $$

where \(h(x)=\max\{\omega(t) : t\leq x\}\). This inequality can be written as

$$ Z(x)\ll x\Bigg( \sum_{k=1}^{\lfloor \log \log x\rfloor} \bigg(\frac{2}{3}\bigg)^{k}\#\mathcal{P}_{k}(x)+ \sum_{k\geq \lfloor \log \log x\rfloor+1} \bigg(\frac{2}{3}\bigg)^{k}\#\mathcal{P}_{k}(x)\Bigg). $$
(8)

In order to obtain an upper bound for the first sum in the right hand side above, we apply Lemma 4 for \(A=1\) and \(z_{k}:=(k-1)/\log \log x<1\). Thus

$$\begin{aligned} \sum_{k=1}^{\lfloor \log \log x\rfloor} \bigg(\frac{2}{3}\bigg)^{k}\#\mathcal{P}_{k}(x) \ll & \sum_{k=1}^{\lfloor \log \log x\rfloor} \bigg(\frac{2}{3}\bigg)^{k}G(z_{k})\cdot \frac{x}{\log x}\frac{(\log \log x)^{k-1}}{(k-1)!}\\ \ll & \frac{x}{\log x} \sum_{k\geq 1}\frac{(\log (\log x)^{2/3})^{k-1}}{(k-1)!}\\ \ll & \frac{x}{\log x}\exp\bigl(\log (\log x)^{2/3}\bigr)=\frac{x}{(\log x)^{1/3}}. \end{aligned}$$

Here, we used that \(G(z_{k})=O(1)\) (as in the proof of Theorem 1). Therefore,

$$ \sum_{k=1}^{\lfloor \log \log x\rfloor} \bigg(\frac{2}{3}\bigg)^{k}\#\mathcal{P}_{k}(x) \ll \frac{x}{(\log x)^{1/3}}. $$
(9)

For the second sum in the right hand side of (8), we have

$$\sum_{k\geq \lfloor \log \log x\rfloor+1} \bigg(\frac{2}{3}\bigg)^{k}\#\mathcal{P}_{k}(x)\ll x\bigg(\frac{2}{3}\bigg)^{\log \log x}, $$

where we used that \(\lfloor \log \log x\rfloor+1>\log \log x\). Since \(2/3<1/\sqrt[3]{e}\), then

$$\bigg(\frac{2}{3}\bigg)^{\log \log x}< e^{-(\log \log x)/3}=(\log x)^{-1/3}. $$

Thus

$$ \sum_{k\geq \lfloor \log \log x\rfloor+1} \bigg(\frac{2}{3}\bigg)^{k}\#\mathcal{P}_{k}(x)\ll \frac{x}{(\log x)^{1/3}}. $$
(10)

By combining (8), (9) and (10), we arrive at

$$Z(x)\ll x\bigg(\frac{x}{(\log x)^{1/3}}+\frac{x}{(\log x)^{1/3}}\bigg)\ll \frac{x^{2}}{(\log x)^{1/3}} $$

as desired.

4 Conclusions

In this paper, we study two problems related to the order (of appearance) in the Fibonacci sequence, denoted by \(z(n)\). This arithmetic function plays an important role in gaining an understanding of some Diophantine problems involving Fibonacci numbers (the open problem about the existence of infinitely many Fibonacci prime numbers is one of the most important of them). In the first problem, we generalize a result of Marques by proving that almost all positive integers satisfy \(z(n)/n<\epsilon \) for any previously fixed \(\epsilon >0\) (more generally, we shall provide a lower bound for the number of positive integers which are smaller than or equal to x with this property). Our second problem is related to the summation function \(Z(n)\) which is defined as the sum of values of \(z(m)\), with the summation going from \(m=1\) to \(m=n\). The trivial upper bound for \(Z(n)\) is \(n(n+1)\), which follows from a result of Sallé. However, our Theorem 1 suggests the existence of a much better upper bound. In fact, we prove that \(Z(n)=O(n^{2}/(\log n)^{1/3})\). The proofs combine some elementary tools related to \(z(n)\) together with a deep result in analytic number theory.